def generatecountry(): """Generate a country""" features = feature_filter('country') country = Country(app.server, features) country.add_regions() return render_template('country.html', tempobj=country)
def test_country_region_count(self): """ """ country = Country(self.redis, {'regioncount': 25}) country.add_regions() self.assertNotEqual('', country.name) self.assertEqual(25, len(country.regions))
def test_country_region(self): """ """ regiona=Region(self.redis) regionb=Region(self.redis) country = Country(self.redis, {'regions': [regiona,regionb]}) self.assertEqual(2, len(country.regions)) country.add_regions() self.assertEqual(2, len(country.regions))
def test_country_region(self): """ """ regiona = Region(self.redis) regionb = Region(self.redis) country = Country(self.redis, {'regions': [regiona, regionb]}) self.assertEqual(2, len(country.regions)) country.add_regions() self.assertEqual(2, len(country.regions))
def test_continent_pass_countries(self): """ """ countrya = Country(self.redis) countryb = Country(self.redis) countryc = Country(self.redis) continent = Continent(self.redis, {'countries': [countrya, countryb, countryc]}) continent.add_countries() self.assertEqual(len(continent.countries), 3) self.assertIn(countrya, continent.countries) self.assertIn(countryb, continent.countries) self.assertIn(countryc, continent.countries) continent.countrycount = 5 continent.add_countries() self.assertEqual(len(continent.countries), 5) self.assertIn(countrya, continent.countries) self.assertIn(countryb, continent.countries) self.assertIn(countryc, continent.countries)
def test_country_region_str(self): """ """ country = Country(self.redis, {'regioncount': 25}) country.add_regions() self.assertEqual('Central Afkil',str(country)) self.assertEqual(25,len(country.regions))
def test_country_region_str(self): """ """ country = Country(self.redis, {'regioncount': 25}) country.add_regions() self.assertEqual('Central Afkil', str(country)) self.assertEqual(25, len(country.regions))
def test_random_country(self): """ """ country = Country(self.redis) self.assertNotEqual('', country.name)
def test_static_body(self): """ """ country = Country(self.redis) govt = Govt(self.redis, {'body': country}) self.assertIn('Central Afkil', str(govt.body)) self.assertEqual(type(govt.body), Country)