Exemplo n.º 1
0
class ApiClientTest(unittest.TestCase):
    """
    Test ApiClient
    """

    def setUp(self):
        inst_id = 111637
        wskey = 'TjBKm4f7QdZwxUrvfnukshyAIPkCgt3ZieslDR23Z95rV8rmqU3gIFvKRRDaTwX4UwzoQtQYIbyCqEWe'
        self.client_json = HttpApiClient(inst_id, wskey, response_format="json")
        self.client_xml = HttpApiClient(inst_id, wskey)

    def tearDown(self):
        pass

    def testExecuteNotImpl(self):
        '''The ApiClient class should not support execute_query() directly.'''
        with self.assertRaises(NotImplementedError):
            self.client_xml.execute_query('test_query')

    def testCreateParamsNotImpl(self):
        '''The ApiClient class should not support create_query_paramsy() directly.'''
        with self.assertRaises(NotImplementedError):
            self.client_xml.create_query_params(keyword='test_query')
Exemplo n.º 2
0
 def setUp(self):
     inst_id = 111637
     wskey = 'TjBKm4f7QdZwxUrvfnukshyAIPkCgt3ZieslDR23Z95rV8rmqU3gIFvKRRDaTwX4UwzoQtQYIbyCqEWe'
     self.client_json = HttpApiClient(inst_id, wskey, response_format="json")
     self.client_xml = HttpApiClient(inst_id, wskey)