def test_as(self): '''Test As''' planet = Planet() planet.size = uwp.Size(0) planet.atmosphere = uwp.Atmosphere(0) planet.hydrographics = uwp.Hydrographics(0) self.assertTrue('As' in gen_trade_codes(planet))
def test_tech_level(self): '''Test tech level results''' planet = Planet() for starport in 'ABCX': for siz in '01234': for atm in '0123ABCDEF': for hyd in '9A': for pop in '123459A': for gov in '05D': planet.starport = starport planet.size = upp.Size(siz) planet.atmosphere = upp.Atmosphere(atm) planet.hydrographics = upp.Hydrographics(hyd) planet.population = upp.Population(pop) planet.government = upp.Government(gov) planet.determine_tech() starport_dm =\ self._starport_dm(planet.starport) siz_dm = self._size_dm(str(planet.size)) atm_dm = self._atm_dm(str(planet.atmosphere)) hyd_dm = self._hyd_dm(str( planet.hydrographics)) pop_dm = self._pop_dm(str(planet.population)) gov_dm = self._gov_dm(str(planet.government)) print( 'port: {} siz: {} atm: {} hyd: {} pop: {} gov: {}' .format(starport_dm, siz_dm, atm_dm, hyd_dm, pop_dm, gov_dm)) tl_dm = starport_dm + siz_dm + atm_dm + hyd_dm tl_dm = tl_dm + pop_dm + gov_dm tech_level = int(planet.tech_level) print('upp: {} TL: {} TL DM: {}'.format( str(planet), tech_level, tl_dm)) self.assertTrue(tech_level - tl_dm in range(1, 7))
def test_not_ic(self): '''Test !Ic''' for atm in '23456789ABC': hyd = 0 planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertFalse('Ic' in gen_trade_codes(planet))
def test_po(self): '''Test Po''' for atm in '2345': for hyd in '0123': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertTrue('Po' in gen_trade_codes(planet))
def test_in(self): '''Test In''' for atm in '012479': for pop in '9A': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.population = uwp.Population(pop) self.assertTrue('In' in gen_trade_codes(planet))
def test_po(self): '''Test Po''' for atm in '016789ABC': for hyd in '456789A': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertFalse('Po' in gen_trade_codes(planet))
def test_not_va(self): '''Test !Va''' for atm in '123456789ABC': for hyd in '123456789A': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertFalse('Va' in gen_trade_codes(planet))
def test_not_fl(self): '''Test !Fl''' for atm in '0123456789': hyd = 0 planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertFalse('Fl' in gen_trade_codes(planet))
def test_de(self): '''Test De''' hyd = 0 for atm in '23456789': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertTrue('De' in gen_trade_codes(planet))
def test_ic(self): '''Test Ic''' for atm in '01': for hyd in '123456789A': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertTrue('Ic' in gen_trade_codes(planet))
def test_in(self): '''Test In''' for atm in '3568ABC': for pop in '012345678': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.population = uwp.Population(pop) self.assertFalse('In' in gen_trade_codes(planet))
def test_no_na(self): '''Test !Na''' for atm in '456789ABC': for hyd in '456789A': for pop in '012345': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) planet.population = uwp.Population(pop) self.assertFalse('Na' in gen_trade_codes(planet))
def test_ri(self): '''Test Ri''' for atm in '68': for pop in '678': for gov in '456789': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.population = uwp.Population(pop) planet.government = uwp.Government(gov) self.assertTrue('Ri' in gen_trade_codes(planet))
def test_ag(self): '''Test Ag''' for atm in '456789': for hyd in '45678': for pop in '567': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) planet.population = uwp.Population(pop) self.assertTrue('Ag' in gen_trade_codes(planet))
def test_not_he(self): '''Test !He''' for siz in '01': for atm in '013568': for hyd in '3456789A': planet = Planet() planet.size = uwp.Size(siz) planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertFalse('He' in gen_trade_codes(planet))
def test_not_wa(self): '''Test !Wa''' for siz in '012BC': for atm in '012ABC': for hyd in '0123456789': planet = Planet() planet.size = uwp.Size(siz) planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertFalse('Wa' in gen_trade_codes(planet))
def test_no_ag(self): '''Test !Ag''' for atm in '0123ABC': for hyd in '01239A': for pop in '012389ABCDEF': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) planet.population = uwp.Population(pop) self.assertFalse('Ag' in gen_trade_codes(planet))
def test_not_oc(self): '''Test !Oc''' for siz in '0123456789': for atm in '012': hyd = '0123456789' planet = Planet() planet.size = uwp.Size(siz) planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertFalse('Oc' in gen_trade_codes(planet))
def test_oc(self): '''Test Oc''' for siz in 'ABCDEF': for atm in '3456789ABC': hyd = 'A' planet = Planet() planet.size = uwp.Size(siz) planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertTrue('Oc' in gen_trade_codes(planet))
def test_he(self): '''Test He''' for siz in '3456789ABC': for atm in '2479ABC': for hyd in '012': planet = Planet() planet.size = uwp.Size(siz) planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertTrue('He' in gen_trade_codes(planet))
def test_ga(self): '''Test Ga''' for siz in '678': for atm in '568': for hyd in '567': planet = Planet() planet.size = uwp.Size(siz) planet.atmosphere = uwp.Atmosphere(atm) planet.hydrographics = uwp.Hydrographics(hyd) self.assertTrue('Ga' in gen_trade_codes(planet))
def test_ri(self): '''Test Ri''' for atm in '01234579ABC': for pop in '0123459ABCDEF': for gov in '012ABCDEF': planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) planet.population = uwp.Population(pop) planet.government = uwp.Government(gov) self.assertFalse('Ri' 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_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_va(self): '''Test Va''' atm = 0 planet = Planet() planet.atmosphere = uwp.Atmosphere(atm) self.assertTrue('Va' in gen_trade_codes(planet))