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])
Exemplo n.º 2
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])
Exemplo n.º 3
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])
Exemplo n.º 4
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])