Skip to content

Commit 93a25f5

Browse files
committed
kindergarten-garden: update tests to version 1.0.0
Renamed existing tests to match test case descriptions. Deleted and added test cases to bring test list into agreement with data. Added missing test version comment.
1 parent 83a981e commit 93a25f5

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

exercises/kindergarten-garden/kindergarten_garden_test.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@
22

33
from kindergarten_garden import Garden
44

5+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
6+
57

68
class KindergartenGardenTests(unittest.TestCase):
7-
def test_alices_garden(self):
9+
def test_garden_with_single_student(self):
810
self.assertEqual(
911
Garden("RC\nGG").plants("Alice"),
1012
"Radishes Clover Grass Grass".split())
1113

12-
def test_bob_and_charlies_gardens(self):
14+
def test_different_garden_with_single_student(self):
15+
self.assertEqual(
16+
Garden("VC\nRC").plants("Alice"),
17+
"Violets Clover Radishes Clover".split())
18+
19+
def test_garden_with_two_students(self):
20+
garden = Garden("VVCG\nVVRC")
21+
self.assertEqual(
22+
garden.plants("Bob"), "Clover Grass Radishes Clover".split())
23+
24+
def test_multiple_students_for_the_same_garden_with_three_students(self):
1325
garden = Garden("VVCCGG\nVVCCGG")
1426
self.assertEqual(garden.plants("Bob"), ["Clover"] * 4)
1527
self.assertEqual(garden.plants("Charlie"), ["Grass"] * 4)
@@ -26,16 +38,6 @@ def test_full_garden(self):
2638
self.assertEqual(
2739
garden.plants("Larry"), "Grass Violets Clover Violets".split())
2840

29-
def test_disordered_test(self):
30-
garden = Garden(
31-
"VCRRGVRG\nRVGCCGCV",
32-
students="Samantha Patricia Xander Roger".split())
33-
self.assertEqual(
34-
garden.plants("Patricia"),
35-
"Violets Clover Radishes Violets".split())
36-
self.assertEqual(
37-
garden.plants("Xander"), "Radishes Grass Clover Violets".split())
38-
3941

4042
if __name__ == '__main__':
4143
unittest.main()

0 commit comments

Comments
 (0)