def test_smoke_namedtuple(self, *args): self.result1['icon'] = api.Icon(**self.icon1) self.result2['icon'] = api.Icon(**self.icon2) self.related_topic['topics'] = [ api.Result(**self.result1), api.Result(**self.result2)] self.response['related_topics'] = [ api.Result(**self.result1), api.Result(**self.result2), api.RelatedTopic(**self.related_topic)] expected = api.Response(**self.response) resp = query('python') self.assertEqual(resp, expected)
def test_https_connection_used(self, conn, *args): query('anything', secure=True) conn.assert_called_once_with(api.SERVER_HOST)
def test_json_response_as_list(self, *args): res = query('anything!') self.assertEqual(res, [1, 'x', True])
def test_python3_utf8_decode(self, *args): # Not relevant to Python 2. if not is_python2(): query('python', container='dict')
def test_smoke_dict(self, *args): self.related_topic['topics'] = [self.result1, self.result2] self.response['related_topics'] = [ self.result1, self.result2, self.related_topic] resp = query('python', container='dict') self.assertTrue(resp == self.response)