Sha256: 8af12a6415f886f578e22e314785a1eb3f7d7236d727e011933ff490495a42f3

Contents?: true

Size: 1.46 KB

Versions: 127

Compression:

Stored size: 1.46 KB

Contents

import unittest

from kindergarten_garden import Garden


class KindergartenGardenTests(unittest.TestCase):

    def test_alices_garden(self):
        self.assertEqual("Radishes Clover Grass Grass".split(),
                         Garden("RC\nGG").plants("Alice"))

    def test_bob_and_charlies_gardens(self):
        garden = Garden("VVCCGG\nVVCCGG")
        self.assertEqual(["Clover"] * 4, garden.plants("Bob"))
        self.assertEqual(["Grass"] * 4, garden.plants("Charlie"))

    def test_full_garden(self):
        garden = Garden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
        self.assertEqual("Violets Radishes Violets Radishes".split(),
                         garden.plants("Alice"))
        self.assertEqual("Clover Grass Clover Clover".split(),
                         garden.plants("Bob"))
        self.assertEqual("Grass Clover Clover Grass".split(),
                         garden.plants("Kincaid"))
        self.assertEqual("Grass Violets Clover Violets".split(),
                         garden.plants("Larry"))

    def test_disordered_test(self):
        garden = Garden("VCRRGVRG\nRVGCCGCV",
                        students="Samantha Patricia Xander Roger".split())
        self.assertEqual("Violets Clover Radishes Violets".split(),
                         garden.plants("Patricia"))
        self.assertEqual("Radishes Grass Clover Violets".split(),
                         garden.plants("Xander"))


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

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
trackler-2.0.8.27 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.26 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.24 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.23 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.22 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.21 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.20 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.19 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.18 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.17 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.16 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.15 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.14 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.13 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.12 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.11 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.10 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.9 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.8 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.0.8.7 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py