Esempio n. 1
0
    def score_is_saved(self):
        gm = GameManager()
        hs = gm.player
        hs.high_score = 50
        name = hs.user

        gm.change_user("test")
        hs = gm.player
        self.assertNotEqual(hs.user, name)

        gm.change_user(name)
        hs = gm.player
        self.assertEqual(hs.user, name)
        self.assertEqual(hs.high_score, 50)
Esempio n. 2
0
 def test_create_new_user(self):
     gm = GameManager()
     gm.change_user("test")
     hs = gm.player
     self.assertEqual(hs.user, "test")
     self.assertEqual(hs.high_score, 0)