Beispiel #1
0
def generateplanet():
    """Generate a planet"""

    features = feature_filter('planet')
    planet = Planet(app.server, features)
    planet.add_continents()
    return render_template('planet.html', tempobj=planet)
 def test_static_moons(self):
     """  """
     moona=Moon(self.redis)
     moonb=Moon(self.redis)
     planet=Planet(self.redis, {'moons':[moona, moonb] })
     planet.add_moons()
     self.assertNotEquals('', planet.name)
 def test_static_continents(self):
     """  """
     continenta=Continent(self.redis)
     continentb=Continent(self.redis)
     planet=Planet(self.redis, {'continents':[continenta, continentb] })
     planet.add_continents()
     self.assertNotEquals('Absobah', planet.name)
Beispiel #4
0
 def test_static_moons(self):
     """  """
     moona = Moon(self.redis)
     moonb = Moon(self.redis)
     planet = Planet(self.redis, {'moons': [moona, moonb]})
     planet.add_moons()
     self.assertNotEquals('', planet.name)
Beispiel #5
0
 def test_static_continents(self):
     """  """
     continenta = Continent(self.redis)
     continentb = Continent(self.redis)
     planet = Planet(self.redis, {'continents': [continenta, continentb]})
     planet.add_continents()
     self.assertNotEquals('Absobah', planet.name)
 def test_creation(self):
     """  """
     planet=Planet(self.redis)
     planet.add_continents()
     planet.add_moons()
     self.assertEquals('Absobah', str(planet))
     self.assertNotEquals(None, planet.continents)
     self.assertNotEquals(None, planet.moons)
 def test_static_continentcount(self):
     """  """
     continenta=Continent(self.redis)
     continentb=Continent(self.redis)
     planet=Planet(self.redis, {'continents':[continenta, continentb], 'continentcount':4 })
     self.assertEqual(len(planet.continents), 2)
     self.assertEqual(planet.continentcount, 2)
     planet.continentcount=4
     planet.add_continents()
     self.assertEqual(len(planet.continents), 4)
Beispiel #8
0
 def test_static_continentcount(self):
     """  """
     continenta = Continent(self.redis)
     continentb = Continent(self.redis)
     planet = Planet(self.redis, {
         'continents': [continenta, continentb],
         'continentcount': 4
     })
     self.assertEqual(len(planet.continents), 2)
     self.assertEqual(planet.continentcount, 2)
     planet.continentcount = 4
     planet.add_continents()
     self.assertEqual(len(planet.continents), 4)
Beispiel #9
0
 def test_creation(self):
     """  """
     planet = Planet(self.redis)
     planet.add_continents()
     planet.add_moons()
     self.assertEquals('Absobah', str(planet))
     self.assertNotEquals(None, planet.continents)
     self.assertNotEquals(None, planet.moons)