Skip to content

Commit cdcd6ac

Browse files
author
Shehab Abdel-Salam
committed
Fix imports
1 parent cefff35 commit cdcd6ac

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

chapters/chapter08_files/tests/test_ch08.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from ..exercises.exercise_ch8_03 import course_grades_summary
88
from ..exercises.exercise_ch8_04 import inventory_management
99

10-
# from ..exercises.exercise_ch8_04 import FileHandler
11-
1210

1311
@pytest.mark.parametrize(
1412
"file_content, expected",
@@ -49,7 +47,8 @@ def test_ch08_e01(source, expected):
4947
"""
5048
),
5149
{},
52-
)(
50+
),
51+
(
5352
textwrap.dedent(
5453
"""
5554
python is a popular programming language
Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
# Exercise 09_02 - Calculator Class
2-
# Given the following `Calculator` class, there is a bug in the class definition.
3-
# Find and fix the bug.
2+
# Create a class called Calculator. The class should have two methods: add and subtract.
3+
# The two methods should be class methods and should take two arguments each.
44

5-
# Example of the expected behavior:
6-
# Calculator.add(1, 2) # Expected output: 3
7-
# Calculator.subtract(1, 2) # Expected output: -1
85

9-
10-
class Calculator:
11-
def add(a: int, b: int) -> int:
12-
return a + b
13-
14-
def subtract(a: int, b: int) -> int:
15-
return a - b
6+
class Calculator: ...

chapters/chapter10_oop/exercises/exercise_ch10_08.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# 6. withdraw(self, account_number: int, amount: float, card_number: int, pin: int) -> None: withdraws money from an account.
2121
# 7. deposit(self, account_number: int, amount: float) -> None: deposits money into an account.
2222

23-
from exercise_ch10_07 import Account, Card
23+
from .exercise_ch10_07 import Account, Card
2424

2525

2626
class Customer:

chapters/chapter10_oop/tests/test_ch10.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from ..exercises.exercise_ch10_01 import Vector3D
22
from ..exercises.exercise_ch10_02 import Calculator
3-
from ..exercises.exercise_ch10_03 import Shape, Square, Circle
4-
from ..exercises.exercise_ch10_04 import Book, Author, Genre
3+
from ..exercises.exercise_ch10_03 import Circle, Shape, Square
4+
from ..exercises.exercise_ch10_04 import Author, Book, Genre
55
from ..exercises.exercise_ch10_05 import BookShelf
66
from ..exercises.exercise_ch10_06 import Library
7-
from ..exercises.exercise_ch10_07 import Card, Account
7+
from ..exercises.exercise_ch10_07 import Account, Card
88
from ..exercises.exercise_ch10_08 import Customer
99
from ..exercises.exercise_ch10_09 import Box
1010

@@ -110,8 +110,8 @@ def test_ch10_e07():
110110
assert isinstance(account, Account)
111111

112112

113+
# TODO
113114
def test_ch10_e08():
114-
# TODO
115115
customer = Customer("John", "Doe")
116116
assert isinstance(customer, Customer)
117117

0 commit comments

Comments
 (0)