From 0c51434f9cf2d017d8b992dc1f7cb78348ba1e84 Mon Sep 17 00:00:00 2001 From: heavenshell Date: Fri, 13 Mar 2015 00:01:11 +0900 Subject: [PATCH] Use patch. --- tests/test_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index 1c1f918..dc96e7f 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -35,8 +35,10 @@ def setUpClass(cls): cls.client = Client(mackerel_api_key=api_key) cls.id = 'xxxxxxxxxxx' - def test_should_get_hosts(self): + @patch('mackerel.client.requests.get') + def test_should_get_hosts(self, m): """ Client().get_hosts() should get host list. """ + dummy_response(m, 'fixtures/get_hosts.json') hosts = self.client.get_hosts() for host in hosts: self.assertTrue(isinstance(host, Host))