Skip to content

Commit 67c5f57

Browse files
TsadoqCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 3175c72 commit 67c5f57

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/test_waytype.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,21 @@ def test_initialization_with_invalid_way_type(self):
2626

2727
def test_initialization_with_invalid_amount(self):
2828
"""
29-
Test initialization with invalid amounts (less than 0, equal to 0, greater than 1)
29+
Test initialization with invalid amounts (less than 0 or greater than 1)
30+
and valid boundary amounts (0 and 1)
3031
"""
3132
valid_way_type = PossibleWayType.list_all()[0]
33+
34+
way_type_zero = WayType(valid_way_type, 0)
35+
self.assertIsInstance(way_type_zero, WayType)
36+
self.assertEqual(way_type_zero.type, valid_way_type)
37+
self.assertEqual(way_type_zero.amount, 0)
38+
39+
way_type_one = WayType(valid_way_type, 1)
40+
self.assertIsInstance(way_type_one, WayType)
41+
self.assertEqual(way_type_one.type, valid_way_type)
42+
self.assertEqual(way_type_one.amount, 1)
43+
3244
for amount in [-1, 2]:
3345
with self.assertRaises(ValueError):
3446
WayType(valid_way_type, amount)

0 commit comments

Comments
 (0)