Exemplo n.º 1
0
 def test_json(self, mock_fn):
     '''Test json() method'''
     expected = '{"name": "", "trade_codes": ["Ni", "Po"], "uwp": "B433432-A"}'
     planet = Planet()
     planet.generate()
     LOGGER.debug('expected      = %s', expected)
     LOGGER.debug('planet.json() = %s', planet.json())
     self.assertTrue(planet.json() == expected)
Exemplo n.º 2
0
 def test_basic_create(self, mock_fn):
     '''Test basic planet create'''
     planet = Planet('Mongo')
     planet.generate()
     LOGGER.debug('planet = %s', str(planet))
     self.assertTrue(planet.name == 'Mongo')
     self.assertTrue(planet.starport == 'B')
     self.assertTrue(str(planet.size) == '4')
     self.assertTrue(str(planet.atmosphere) == '3')
     self.assertTrue(str(planet.hydrographics) == '3')
     self.assertTrue(str(planet.population) == '4')
     self.assertTrue(str(planet.government) == '3')
     self.assertTrue(str(planet.lawlevel) == '2')
     self.assertTrue(str(planet.techlevel) == 'A')
Exemplo n.º 3
0
 def test_str(self, mock_fn):
     '''Test str() method'''
     expected = 'B433432-A'
     planet = Planet()
     planet.generate()
     self.assertTrue(str(planet) == expected)