Exemple #1
0
    def test_game_uses_timer(self):
        conf = MockGameConfigObject()
        conf.game_timer = MockGameTimer()
        game = Game(conf)
        game.start()

        for x in range(0, 6):
            self.assertTrue(game.run())

        self.assertFalse(game.run())
Exemple #2
0
 def test_start_before_run(self):
     conf = MockGameConfigObject()
     conf.game_timer = MockGameTimer()
     game = Game(conf)
     self.assertFalse(game.run())
     game.injectConfig(conf)
     game.start()
     self.assertTrue(game.run())
Exemple #3
0
 def test_inject_config(self):
     conf = MockGameConfigObject()
     game = Game()
     self.assertEqual(game.config, None)
     game.injectConfig(conf)
     self.assertEqual(game.config, conf)