示例#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')
示例#2
0
 def test_city_country_population(self):
     test_city = city_country('santiago', 'chile', '50000')
     self.assertEqual(test_city, "Santiago, Chile - population 50000.")
示例#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')
示例#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")
示例#6
0
 def test_city_country(self):
     formatted_name = city_country("Beni", "Kongo")
     self.assertEqual(formatted_name, "Beni,Kongo.")
示例#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')
示例#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")
示例#10
0
 def test_city_country(self):
     city_country_name = city_country('santiago', 'chile')
     self.assertEqual(city_country_name, 'Santiago, Chile')
示例#11
0
 def test_city_country_population(self):
     city_country_name = city_country('santiago', 'chile', '5000000')
     self.assertEqual(city_country_name, 'Santiago, Chile 5000000')
示例#12
0
 def test_city_country_population(self):
     str = city_country('shanghai', 'china', 'population=10000')
     self.assertEqual(str, 'shanghai,china - population 10000')
示例#13
0
 def test_city_country(self):
     str = city_country('shanghai', 'china')
     self.assertEqual(str, 'shanghai,china')
示例#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)
示例#15
0
 def test_city_country(self):
     formatted = city_country('santiago', 'chile')
     self.assertEqual('Santiago, Chile', formatted)
示例#16
0
 def test_city_country(self):
     city_and_country = city_country('santiago', 'chile')
     self.assertEqual(city_and_country, 'Santiago, Chile')
示例#17
0
import city_function

print(city_function.city_country("kuala lumpur", "Malaysia"))
示例#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')
示例#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')
示例#20
0
 def test_city_country(self):
     self.assertEqual(city_country("santiago","chile"),"Santiago Chile")
示例#21
0
 def test_city_country_population(self):
     formatted_name = city_country("Beni", "Kongo", "700000")
     self.assertEqual(formatted_name, "Beni,Kongo,Population:700000.")
示例#22
0
 def test_city_country_population(self):
     self.assertEqual(city_country("santiago", "chile", "5000000"), "Santiago Chile - population 5000000")
示例#23
0
 def test_city_country(self):
     fn_city_country = city_country("Paris", "France")
     self.assertEqual(fn_city_country, "Paris France")
示例#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.')
示例#26
0
 def test_city_country(self):
     information = city_country('beijing', 'China')
     self.assertEqual(information, 'Beijing, China')
示例#27
0
	def test_city_country_2(self):
		result = city_country('tokyo','japan','80000')
		self.assertEqual(result,'Tokyo, Japan - population 80000')
示例#28
0
 def test_city_country(self):
     formatted_city = city_country("bangkok", "thailand", 500000)
     self.assertEqual(formatted_city,
                      "Bangkok, Thailand - population 500000")
示例#29
0
	def test_city_country_1(self):
		result = city_country('beijing','china')
		self.assertEqual(result,'Beijing,China')
示例#30
0
 def test_cityandcountry(self):
     test_city = city_country('santiago', 'chile')
     self.assertEqual(test_city, 'Santiago, Chile - population 0.')