Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added exo1/__pycache__/exo1.cpython-311.pyc
Binary file not shown.
15 changes: 9 additions & 6 deletions exo1/test_exo1.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import unittest

from exo1 import Item


class Exo1Test(unittest.TestCase):
"Reviewing code"
class Item:
def __init__(self,prix, weight):
self.price = prix
self.weight = weight

def test_item_construction(self):
item = Item(10, 20)
def display_item(self):
print(f"Item: Price: {self.price}, Weight: {self.weight} kg")

self.assertEqual(20, item.weight)
item1 = Item( 45, 10)
item1.display_item()