Beispiel #1
0
    def test_feeding_plenty(self):
        """
        Test for herbivore feeding method with plenty of fodder.

        Returns
        -------

        """
        h1 = Herbivore(age=5, weight=20)
        j1 = Jungle()
        h1.feeding(j1)
        assert h1.weight == 29
        assert j1.get_fodder() == 790
Beispiel #2
0
    def test_feeding_none(self):
        """
        Test for herbivore feeding method with no fodder.

        Returns
        -------

        """
        h1 = Herbivore(age=5, weight=20)
        j1 = Jungle()
        j1.fodder = 0
        h1.feeding(j1)
        assert h1.weight == 20
        assert j1.get_fodder() == 0