Example #1
0
	def test_update(self):
		"""
		Tests that the ruleset update method runs..
		"""
		ln = self.__class__.__name__
		r = Game(shortname=ln).ruleset
		r.update()
Example #2
0
	def test_turn(self):
		"""
		Test that the ruleset turn method runs..
		"""
		ln = self.__class__.__name__
		r = Game(shortname=ln).ruleset
		r.turn()
Example #3
0
	def test_player(self):
		"""
		Tests that the ruleset can add a player.
		"""
		ln = self.__class__.__name__
		r = Game(shortname=ln).ruleset
		r.player('testplayer1', 'password', 'email', 'comment')	
Example #4
0
	def setup_class(cls):
		# Okay create a new game then
		print 'Class name!', cls.__name__

		g = Game()
		g.ruleset  = ruleset
		g.shortname= cls.__name__
		g.longname = cls.__name__
		g.admin    = 'admin@localhost'
		g.comment  = 'A test game'
		g.turn     = 0
		g.commandline="Unknown!"
		g.save()

		g.ruleset.initialise()
Example #5
0
	def test_initialise(self):
		"""
		Tests that we can initialise a new game using the ruleset.
		"""
		# Okay create a new game then
		g = Game()
		g.ruleset  = ruleset
		g.shortname= self.__class__.__name__
		g.longname = gamename
		g.admin    = 'admin@localhost'
		g.comment  = 'A test game'
		g.turn     = 0
		g.commandline="Unknown!"
		g.save()

		g.ruleset.initialise()
Example #6
0
 def game_set(self, value):
     if hasattr(self, '__game'):
         raise TypeError('The game can not be changed!')
     self.__game = Game(id=value)
Example #7
0
	def test_load(self):
		"""
		Tests that a ruleset can be successfully loaded.
		"""
		g = Game()
		g.ruleset  = ruleset