Light Mode
Dark Mode
Army_1(20) > Army_2(21)?

In the test below army1 has 20 warriors and army2 has 21 warriors. Right result for this battle is True (army_1 won). How? How the army that have exactly the same units but fewer people was able to won the battle?

army_1 = Army()
army_2 = Army()
army_1.add_units(Warrior, 20)
army_2.add_units(Warrior, 21) 
battle = Battle()
assert battle.fight(army_1, army_2) == True

Also there one more test that have similar conditions. Right result is really right.

army_1 = Army()
army_2 = Army()
army_1.add_units(Warrior, 2)
army_2.add_units(Warrior, 3) 
battle = Battle()
assert battle.fight(army_1, army_2) == False

So, i suppose that the some tests are incorrect.

Created: Aug. 2, 2018, 10:15 a.m.
Updated: July 12, 2020, 9:22 a.m.
7
15
User avatar
Immersion