def test_not_di(self): '''Test !Di''' for pop in '123456789ABCDEF': for gov in '123456789ABCDEF': for law in '123456789ABCDEFGHJ': planet = Planet() planet.population = uwp.Population(pop) planet.government = uwp.Government(gov) planet.law_level = uwp.LawLevel(law) self.assertFalse('Di' in gen_trade_codes(planet))
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))
def test_no_px(self): '''Test !Px''' for atm in '01456789C': for hyd in '6789A': for pop in '012789ABCDEF': for law in '012345ABCDEF': # Also need to check MW planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) planet.population = uwp.Population(pop) planet.law_level = uwp.LawLevel(law) self.assertFalse('Px' in gen_trade_codes(planet))
def test_px(self): '''Test Px''' for atm in '23AB': for hyd in '12345': for pop in '3456': for law in '6789': # Also need to check MW planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) planet.population = uwp.Population(pop) planet.law_level = uwp.LawLevel(law) self.assertTrue('Px' in gen_trade_codes(planet))
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))