コード例 #1
0
 def setUp(self):
     self.tmpdir = tempfile.mkdtemp()
     self.curdir = os.getcwd()
     os.chdir(self.tmpdir)
     self.seed_scores = {'Dykstra': 5, 'Kruk': 11}
     for player, score in self.seed_scores.items():
         highscores.record(player, score)
コード例 #2
0
 def setUp(self):
     self.tmpdir = tempfile.mkdtemp()
     self.curdir = os.getcwd()
     os.chdir(self.tmpdir)
     self.seed_scores = {'Dykstra':5, 'Kruk':11}
     for player, score in self.seed_scores.items():
         highscores.record(player, score)
コード例 #3
0
 def testNewPlayer(self):
     observed = highscores.record('Daulton', 7)
     self.assertEqual(observed, 7)
コード例 #4
0
 def testNotHighScore(self):
     observed = highscores.record('Kruk', 9)
     self.assertEqual(observed, 11)
コード例 #5
0
 def testNewHighScore(self):
     observed = highscores.record('Dykstra', 10)
     self.assertEqual(observed, 10)
コード例 #6
0
 def testNewPlayer(self):
     observed=highscores.record('Daulton', 7)
     self.assertEqual(observed, 7)
コード例 #7
0
 def testNotHighScore(self):
     observed=highscores.record('Kruk', 9)
     self.assertEqual(observed, 11)
コード例 #8
0
 def testNewHighScore(self):
     observed=highscores.record('Dykstra', 10)
     self.assertEqual(observed, 10)