Sha256: ce29ee7225156f30401c35e0e3d5c34bfd1d111ee623f03a81c8b4f94f9cd947

Contents?: true

Size: 1.41 KB

Versions: 147

Compression:

Stored size: 1.41 KB

Contents

import unittest

from kindergarten_garden import Garden


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

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

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

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


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

Version data entries

147 entries across 147 versions & 1 rubygems

Version Path
trackler-2.2.1.56 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.55 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.54 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.53 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.52 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.51 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.50 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.49 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.48 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.47 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.46 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.45 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.44 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.43 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.42 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.41 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.40 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.39 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.38 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py
trackler-2.2.1.37 tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py