Exemple #1
0
 def test_remove_migrated_carn(self):
     cell = BaseCell()
     assert len(cell.carnivores) == 0
     carnivore = Carnivore()
     cell.add_migrated_carn(carnivore)
     assert len(cell.carnivores) == 1
     cell.remove_migrated_carn(carnivore)
     assert len(cell.carnivores) == 0
Exemple #2
0
 def test_remove_migrated_herb(self):
     cell = BaseCell()
     assert len(cell.herbivores) == 0
     herbivore = Herbivore()
     cell.add_migrated_herb(herbivore)
     assert len(cell.herbivores) == 1
     cell.remove_migrated_herb(herbivore)
     assert len(cell.herbivores) == 0
Exemple #3
0
 def test_add_migrated_carn(self):
     cell = BaseCell()
     assert len(cell.carnivores) == 0
     cell.add_migrated_carn(Carnivore())
     assert len(cell.carnivores) == 1
Exemple #4
0
 def test_add_migrated_herb(self):
     cell = BaseCell()
     assert len(cell.herbivores) == 0
     cell.add_migrated_herb(Herbivore())
     assert len(cell.herbivores) == 1
Exemple #5
0
 def test_grow(self):
     cell = BaseCell()
     cell.grow()
     assert True
Exemple #6
0
 def test_init(self):
     cell = BaseCell()
     assert type(cell.herbivores) is list
     assert type(cell.carnivores) is list
     assert cell.fodder == 0
Exemple #7
0
 def test_num_animals(self):
     cell = BaseCell()
     carnivores = cell.num_carnivores
     herbivores = cell.num_herbivores
     assert cell.num_animals == carnivores + herbivores
Exemple #8
0
 def test_num_herbivore(self):
     cell = BaseCell()
     assert cell.num_herbivores == 0