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"))
Пример #2
0
def test_load_config_from_json():

    garden = Garden(0,0,world)
    config = {'garden':{'capacity':5}, 'robot':{'speed':5}}
    with open('test_config.json', 'w+') as f:
        f.write(json.dumps(config))
    garden._load_config_from_json('test_config.json')
    assert garden.capacity == 5
Пример #3
0
def test_harvest():
    garden = Garden(0,0,world)
    garden.capacity = 5

    for i in range(5):
        assert garden.harvest()

    assert not garden.harvest()
    assert garden.is_fully_harvested()
 def xtest_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 xtest_bob_and_charlies_gardens(self):
     garden = Garden("VVCCGG\nVVCCGG")
     self.assertEqual(["Clover"] * 4, garden.plants("Bob"))
     self.assertEqual(["Grass"] * 4, garden.plants("Charlie"))
Пример #6
0
def test_load_config():
    garden = Garden(0,0,world)
    config = {'garden':{'capacity':5}, 'robot':{'speed':5}}

    garden._load_config(config)
    assert garden.capacity == 5