Esempio n. 1
0
 def test_tournament_simple(self):
     args = [
         'tournament',
         'Discarder',
     ]
     parsed = playgame.parse_args(args)
     self.assertEquals(2, parsed.per_round)
     self.assertEquals(parsed.command, 'tournament')
     self.assertEquals(1, parsed.iterations)
Esempio n. 2
0
 def test_game_simple(self):
     args = ['single', 'Discarder']
     parsed = playgame.parse_args(args)
     print(parsed)
     self.assertEqual(1, len(parsed.players))
     self.assertEquals(0, parsed.variant)
     self.assertFalse(parsed.verbose)
     self.assertEquals(None, parsed.log_dir)
     self.assertEquals(None, parsed.log_stderr)
     self.assertEquals(1, parsed.iterations)
     self.assertEquals(parsed.command, 'single')
Esempio n. 3
0
 def test_tournament_per_round(self):
     args = ['tournament', 'Discarder', '-p', '4']
     parsed = playgame.parse_args(args)
     self.assertEquals(parsed.command, 'tournament')
     self.assertEquals(4, parsed.per_round)
Esempio n. 4
0
 def test_game_seed(self):
     args = ['single', 'Discarder', '-s', '76']
     parsed = playgame.parse_args(args)
     self.assertEquals(76, parsed.seed)
Esempio n. 5
0
 def test_game_log_stderr(self):
     args = ['single', 'Discarder', '-e', 'errors.txt']
     parsed = playgame.parse_args(args)
     self.assertEquals('errors.txt', parsed.log_stderr)
Esempio n. 6
0
 def test_game_log_dir(self):
     args = ['single', 'Discarder', '-l', 'results.txt']
     parsed = playgame.parse_args(args)
     self.assertEquals('results.txt', parsed.log_dir)
Esempio n. 7
0
 def test_game_verbose(self):
     args = ['single', 'Discarder', '-v']
     parsed = playgame.parse_args(args)
     self.assertTrue(parsed.verbose)
Esempio n. 8
0
 def test_game_variant(self):
     args = ['single', 'Discarder', '-r', '3']
     parsed = playgame.parse_args(args)
     self.assertEquals(3, parsed.variant)
Esempio n. 9
0
 def test_game_iterations(self):
     args = ['single', 'Discarder', '-i', '10']
     parsed = playgame.parse_args(args)
     self.assertEquals(10, parsed.iterations)
     self.assertEquals(parsed.command, 'single')