예제 #1
0
    def test_after_win(self):
        gauntlet = GauntletArena("foo")
        gauntlet.handle_winners("baddie", ["foo"])
        self.assertEqual(gauntlet.wins, {"baddie": 1})

        gauntlet.handle_winners("baddie", ["foo"])
        self.assertEqual(gauntlet.wins, {"baddie": 2})
        gauntlet.tries = {"baddie": 2}
        string = repr(gauntlet)
        self.assertIn("PASS", string)
        self.assertIn("2/2 (100.0%)", string)
예제 #2
0
 def test_after_loss(self):
     gauntlet = GauntletArena("foo")
     gauntlet.handle_winners("baddie", ["baddie"])
     self.assertEqual(gauntlet.wins, {"baddie": 0})