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
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
def test_add_migrated_carn(self): cell = BaseCell() assert len(cell.carnivores) == 0 cell.add_migrated_carn(Carnivore()) assert len(cell.carnivores) == 1
def test_add_migrated_herb(self): cell = BaseCell() assert len(cell.herbivores) == 0 cell.add_migrated_herb(Herbivore()) assert len(cell.herbivores) == 1
def test_grow(self): cell = BaseCell() cell.grow() assert True
def test_init(self): cell = BaseCell() assert type(cell.herbivores) is list assert type(cell.carnivores) is list assert cell.fodder == 0
def test_num_animals(self): cell = BaseCell() carnivores = cell.num_carnivores herbivores = cell.num_herbivores assert cell.num_animals == carnivores + herbivores
def test_num_herbivore(self): cell = BaseCell() assert cell.num_herbivores == 0