Esempio n. 1
0
 def test_city_country_population(self):
     """Does adding a population to the city, country pair work?"""
     santiago_chile_50000 = city_country('santiago',
                                         'chile',
                                         population=50000)
     self.assertEqual(santiago_chile_50000,
                      'Santiago, Chile - population 50000')
Esempio n. 2
0
 def test_city_country_population(self):
     test_city = city_country('santiago', 'chile', '50000')
     self.assertEqual(test_city, "Santiago, Chile - population 50000.")
Esempio n. 3
0
	def test_city_country_3(self):
		result = city_country('tokyo','japan')
		self.assertEqual(result,'Tokyo, Japan')
 def test_city_country(self):
     city_and_country = city_country('Kiev', 'ukraine')
     self.assertEqual(city_and_country, 'Kiev, Ukraine')
Esempio n. 5
0
 def test_city_country_population(self):
     fn_city_country = city_country('Paris', 'France', '10000')
     self.assertEqual(fn_city_country, "Paris France population: 10000")
Esempio n. 6
0
 def test_city_country(self):
     formatted_name = city_country("Beni", "Kongo")
     self.assertEqual(formatted_name, "Beni,Kongo.")
Esempio n. 7
0
 def test_city_country_case(self):
     """Does a simple city and country pair work?"""
     santiago_chile = city_country('santiago', 'chile')
     self.assertEqual(santiago_chile, 'Santiago, Chile')
Esempio n. 8
0
 def test_city_country(self):
     testing_cities = city_country("berlin", "alemania")
     self.assertEqual(testing_cities, "Berlin, Alemania")
 def test_city_country(self):
     """Does Santiago, Chile Work?"""
     formatted_city_country = city_country("santiago", "chile")
     self.assertEqual(formatted_city_country, "Santiago, Chile")
Esempio n. 10
0
 def test_city_country(self):
     city_country_name = city_country('santiago', 'chile')
     self.assertEqual(city_country_name, 'Santiago, Chile')
Esempio n. 11
0
 def test_city_country_population(self):
     city_country_name = city_country('santiago', 'chile', '5000000')
     self.assertEqual(city_country_name, 'Santiago, Chile 5000000')
Esempio n. 12
0
 def test_city_country_population(self):
     str = city_country('shanghai', 'china', 'population=10000')
     self.assertEqual(str, 'shanghai,china - population 10000')
Esempio n. 13
0
 def test_city_country(self):
     str = city_country('shanghai', 'china')
     self.assertEqual(str, 'shanghai,china')
Esempio n. 14
0
from city_function import city_country

print("Enter 'q' at any time to quit.")
while True:
    city = input("\nPlease give me a city's name: ")
    if city == 'q':
        break
    country = input(
        "Please give me a country's name which matches the city you just input: "
    )
    if country == 'q':
        break
    city_c = city_country(city, country)

    print(city_c)
Esempio n. 15
0
 def test_city_country(self):
     formatted = city_country('santiago', 'chile')
     self.assertEqual('Santiago, Chile', formatted)
Esempio n. 16
0
 def test_city_country(self):
     city_and_country = city_country('santiago', 'chile')
     self.assertEqual(city_and_country, 'Santiago, Chile')
Esempio n. 17
0
import city_function

print(city_function.city_country("kuala lumpur", "Malaysia"))
Esempio n. 18
0
 def test_city_country_population(self):
     city_and_country_population = city_country('santiago', 'chile',
                                                '5000000')
     self.assertEqual(city_and_country_population,
                      'Santiago, Chile - Population 5000000')
Esempio n. 19
0
 def test_city_country_population(self):
     """Can I include a population argument?"""
     santiago_chile = city_country('santiago', 'chile', population=5000000)
     self.assertEqual(santiago_chile,
                      'Santiago, Chile - population 5000000')
Esempio n. 20
0
 def test_city_country(self):
     self.assertEqual(city_country("santiago","chile"),"Santiago Chile")
Esempio n. 21
0
 def test_city_country_population(self):
     formatted_name = city_country("Beni", "Kongo", "700000")
     self.assertEqual(formatted_name, "Beni,Kongo,Population:700000.")
Esempio n. 22
0
 def test_city_country_population(self):
     self.assertEqual(city_country("santiago", "chile", "5000000"), "Santiago Chile - population 5000000")
Esempio n. 23
0
 def test_city_country(self):
     fn_city_country = city_country("Paris", "France")
     self.assertEqual(fn_city_country, "Paris France")
Esempio n. 24
0
 def test_city_country_population(self):
     """再编写一个名为test_city_country_population() 的测试, 核实可以使用类似于'santiago' 、 'chile' 和
     'population=5000000' 这样的值来调用这个函数。 再次运行test_cities.py, 确认测试test_city_country_population()
      通过了。"""
     information = city_country('shanghai', 'China', population=50000)
     self.assertEqual(information, 'Shanghai, China - Population 50000')
 def test_city_country_population(self):
     city_and_country = city_country('Kiev', 'ukraine', '50000')
     self.assertEqual(city_and_country, 'Kiev, Ukraine - Population 50000.')
Esempio n. 26
0
 def test_city_country(self):
     information = city_country('beijing', 'China')
     self.assertEqual(information, 'Beijing, China')
Esempio n. 27
0
	def test_city_country_2(self):
		result = city_country('tokyo','japan','80000')
		self.assertEqual(result,'Tokyo, Japan - population 80000')
Esempio n. 28
0
 def test_city_country(self):
     formatted_city = city_country("bangkok", "thailand", 500000)
     self.assertEqual(formatted_city,
                      "Bangkok, Thailand - population 500000")
Esempio n. 29
0
	def test_city_country_1(self):
		result = city_country('beijing','china')
		self.assertEqual(result,'Beijing,China')
Esempio n. 30
0
 def test_cityandcountry(self):
     test_city = city_country('santiago', 'chile')
     self.assertEqual(test_city, 'Santiago, Chile - population 0.')