Esempio n. 1
0
 def test_location_brazil_kwarg_only(self):
     test = url.ibge_make_locations_query(brazil="yes")
     expected = "&localidades=BR"
     self.assertEqual(test, expected)
Esempio n. 2
0
 def test_mixed_kwargs_and_values(self):
     test = url.ibge_make_locations_query(municipality="all",
                                          state=[4, 5],
                                          brazil="yes")
     expected = "&localidades=N6|N3[4,5]|BR"
     self.assertEqual(test, expected)
Esempio n. 3
0
 def test_location_default_to_brazil(self):
     test = url.ibge_make_locations_query()
     expected = "&localidades=BR"
     self.assertEqual(test, expected)
Esempio n. 4
0
 def test_location_various_regions_mixed_values(self):
     test = url.ibge_make_locations_query(municipality=True,
                                          state=[4, 5],
                                          mesoregion="yes")
     expected = "&localidades=N6|N3[4,5]|N7"
     self.assertEqual(test, expected)
Esempio n. 5
0
 def test_location_various_regions_boolean_values(self):
     test = url.ibge_make_locations_query(municipality=True,
                                          state=True,
                                          mesoregion=True)
     expected = "&localidades=N6|N3|N7"
     self.assertEqual(test, expected)
Esempio n. 6
0
 def test_location_multiple_municipalities(self):
     test = url.ibge_make_locations_query(municipality=["1", "2", "3"])
     expected = "&localidades=N6[1,2,3]"
     self.assertEqual(test, expected)
Esempio n. 7
0
 def test_location_list_single_value(self):
     test = url.ibge_make_locations_query(municipality=1)
     expected = "&localidades=N6[1]"
     self.assertEqual(test, expected)
Esempio n. 8
0
 def test_location_boolean_value(self):
     test = url.ibge_make_locations_query(municipality=True)
     expected = "&localidades=N6"
     self.assertEqual(test, expected)