Example #1
0
 def parse_json(self, data):
     self._distance = data['distance']['value']
     self._distance_text = data['distance']['text']
     self._duration = data['duration']['value']
     self._duration_text = data['duration']['text']
     self._instructions = TextUtils.strip_html(data['html_instructions'])
Example #2
0
 def test_strip_html(self):
     self.assertEquals("", TextUtils.strip_html(""))
     self.assertEquals("", TextUtils.strip_html("<html></html>"))
     self.assertEquals("Hello World", TextUtils.strip_html("<html>Hello <b>World</b></html>"))