예제 #1
0
def test_add_animal():
    """
    test:permet d’ajouter un Animal dans la liste
    """
    test_enclosure = Enclosure("test")
    test_animal1 = Animal("Test1", 5, 10, "testing2")
    test_enclosure.add_animal(test_animal1)
    assert len(test_enclosure.get_list_animaux()) == 1
예제 #2
0
def test_remove_animal():
    """
    test:permet de retirer un Animal de la liste en fonction de sa position dans la liste
    """
    test_animal1 = Animal("Test1", 5, 10, "testing1")
    test_animal2 = Animal("Test2", 10, 10, "testing2")
    test_enclosure = Enclosure("test", [test_animal1, test_animal2])
    test_enclosure.remove_animal(1)
    assert len(test_enclosure.get_list_animaux()) == 1
예제 #3
0
def test_get_list_animaux():
    """
    test getteur de name
    """
    animal1 = Animal("test1")
    animal2 = Animal("test2")
    animal3 = Animal("test3")
    test_enclosure = Enclosure("test", [animal1, animal2, animal3])
    assert test_enclosure.get_list_animaux() == [animal1, animal2, animal3]