示例#1
0
 def test_g_add_dog_increases_dog_count(self):
     kennel = Kennel()
     owner = Owner('1', 'A', 'B', 2, kennel)
     owner.add_dog('name1', 'breed1', 'gender1', 'favorite_food1')
     assert len(owner.all_my_dogs) == 1
     owner.add_dog('name2', 'breed2', 'gender2', 'favorite_food2')
     assert len(owner.all_my_dogs) == 2
 def test_d_has_one_dog_returns_false_with_2_dogs(self):
     kennel = Kennel()
     owner = Owner('id', 'first_name', 'last_name', 'birth_date', kennel)
     owner.add_dog('name1', 'breed1', 'gender1', 'favorite_food1')
     owner.add_dog('name2', 'breed2', 'gender2', 'favorite_food2')
     returned = owner.has_one_dog()
     assert returned == False
示例#3
0
def test():
    date1 = date(1999, 5, 5)
    date2 = date(2000, 5, 5)
    date3 = date(2002, 5, 1)
    date4 = date(2022, 5, 1)
    date5 = date(2022, 5, 2)
    dog1 = Dog("firulais", date1, "galgo")
    dog2 = Dog("cholo", date2, "pitbull")
    dogs = [dog1, dog2]
    owner1 = Owner("Diego", "123456789-1", [dog1, dog2])
    dog3 = Dog("cleo", date3, "golden retriever")
    owner1.add_dog(dog3)
    dogs = owner1.dogs
    race1 = Race(date4, dogs)
    race2 = Race(date5, dogs)
    races = [race1, race2]
    event1 = Event(date4, date5, "Santiago", races)
    race1.run_race()
    positions_table = race1.make_positions_table()
    print(positions_table)
 def test_c_has_one_dog_returns_true_with_1_dog(self):
     kennel = Kennel()
     owner = Owner('id', 'first_name', 'last_name', 'birth_date', kennel)
     owner.add_dog('name1', 'breed1', 'gender1', 'favorite_food1')
     returned = owner.has_one_dog()
     assert returned == True