Esempio n. 1
0
    def test_from_dict(self):
        data = {'name': 'test', 'longitude': 0, 'latitude': 0}

        location = Location.from_dict(data)

        self.assertEqual(location.name, data['name'])
        self.assertEqual(location.latitude, data['latitude'])
        self.assertEqual(location.longitude, data['longitude'])
Esempio n. 2
0
 def __apply_suggestion(self, suggestion):
     self.currently_used_suggestion = Location.from_dict(suggestion)
     pretty_suggestion = suggestion['name'] + ' ' + suggestion['district']
     self.ignore_text_change = self.textfield.text = pretty_suggestion