def test_timings(self, m_request): m_request.return_value = (None, None) client = novaclient.client.HTTPClient(user="******", password="") client._time_request("http://no.where", "GET") self.assertEqual(0, len(client.times)) client = novaclient.client.HTTPClient(user="******", password="", timings=True) client._time_request("http://no.where", "GET") self.assertEqual(1, len(client.times)) self.assertEqual("GET http://no.where", client.times[0][0])
def test_timings(self, m_request): m_request.return_value = (None, None) client = novaclient.client.HTTPClient(user='******', password='') client._time_request("http://no.where", 'GET') self.assertEqual(0, len(client.times)) client = novaclient.client.HTTPClient(user='******', password='', timings=True) client._time_request("http://no.where", 'GET') self.assertEqual(1, len(client.times)) self.assertEqual('GET http://no.where', client.times[0][0])
def test_timings(self): self.requests_mock.get('http://no.where') client = novaclient.client.HTTPClient(user='******', password='') client._time_request("http://no.where", 'GET') self.assertEqual(0, len(client.times)) client = novaclient.client.HTTPClient(user='******', password='', timings=True) client._time_request("http://no.where", 'GET') self.assertEqual(1, len(client.times)) self.assertEqual('GET http://no.where', client.times[0][0])