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)
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)