Ejemplo n.º 1
0
 def test_ba(self):
     '''Test Ba'''
     pop = 0
     gov = 0
     law = 0
     tl = 0
     planet = Planet()
     planet.population = uwp.Population(pop)
     planet.government = uwp.Government(gov)
     planet.law_level = uwp.LawLevel(law)
     planet.tech_level = uwp.TechLevel(tl)
     self.assertTrue('Ba' in gen_trade_codes(planet))
Ejemplo n.º 2
0
 def test_not_ba(self):
     '''Test !Ba'''
     for pop in '123456789A':
         for gov in '123456789AB':
             for law in '123456789A':  # Assume the rest are OK
                 for tech in '123456':  # Assume the rest are OK
                     for starport in 'ABCD':
                         planet = Planet()
                         planet.starport = starport
                         planet.population = uwp.Population(pop)
                         planet.government = uwp.Government(gov)
                         planet.law_level = uwp.LawLevel(law)
                         planet.tech_level = uwp.TechLevel(tech)
                         self.assertFalse('Ba' in gen_trade_codes(planet))
Ejemplo n.º 3
0
 def test_no_lt(self):
     '''Test !Lt'''
     for tech_level in '56789ABCDEF':
         planet = Planet()
         planet.tech_level = uwp.TechLevel(tech_level)
         self.assertFalse('Lt' in gen_trade_codes(planet))
Ejemplo n.º 4
0
 def test_no_ht(self):
     '''Test !Ht'''
     for tech_level in '0123456778AB':
         planet = Planet()
         planet.tech_level = uwp.TechLevel(tech_level)
         self.assertFalse('Ht' in gen_trade_codes(planet))
Ejemplo n.º 5
0
 def test_lt(self):
     '''Test Lt'''
     for tech_level in '01234':
         planet = Planet()
         planet.tech_level = uwp.TechLevel(tech_level)
         self.assertTrue('Lt' in gen_trade_codes(planet))
Ejemplo n.º 6
0
 def test_ht(self):
     '''Test Ht'''
     for tech_level in 'CDEF':
         planet = Planet()
         planet.tech_level = uwp.TechLevel(tech_level)
         self.assertTrue('Ht' in gen_trade_codes(planet))