Beispiel #1
0
class planetFunctions(unittest.TestCase):
	
	def setUp(self):
		datastream = StringIO(data)
		self.u = MyUniverse(Game, planet_class = Planet2)
		for line in datastream:
			line = line.strip()
			self.u.update(line)
	def testmyplanets(self):
		my_planets = sorted(self.u.my_planets, key=lambda p: p.id)
		n_planets = sorted(self.u.nobodies_planets, key=lambda p: p.id)
		print my_planets[2].needed_def()
		print n_planets[15]
		print my_planets[0].distance(n_planets[15])
		print my_planets[0].breakeven(n_planets[15])
		print my_planets[0].first_turn_profit(n_planets[15], 40)
		print my_planets[0].first_turn_profit(n_planets[0], 40)
		print my_planets[0].first_turn_profit(n_planets[3], 40)
Beispiel #2
0
	def setUp(self):
		datastream = StringIO(data)
		self.u = MyUniverse(Game, planet_class = Planet2)
		for line in datastream:
			line = line.strip()
			self.u.update(line)