コード例 #1
0
	def test_setup(self):
		self.assertEquals(2,len(Tile.all()))
		self.assertEquals(1,len(Tile.all().filter('name =','open')))
		self.assertEquals(1,len(Tile.all().filter('name =','blocked')))
		open = Tile.all().filter('name =','open')[0]
		Map(name="testmap",tile=open,x=0,y=0).put()
		self.assertEquals(1,len(Map.all()))
コード例 #2
0
	def setUp(self):
		open = Tile(image='http://www.foo.com/open.png',name='open',blocked=False,opacity=0)
		open.put()
		blocked = Tile(image='http://www.foo.com/blocked.png',name='blocked',blocked=True,opacity=10)
		blocked.put()
		for x in range(10):
			for y in range(10):
				Map(name="testmap",tile=open,x=x,y=y).put()
コード例 #3
0
	def test_setup(self):
		self.assertEquals(100,len(Map.all()))