aboutsummaryrefslogtreecommitdiffstats
path: root/app/test/fetch/api_fetch/test_api_fetch_availability_zone.py
diff options
context:
space:
mode:
authorIlia Abashin <abashinos@gmail.com>2017-08-23 12:56:18 +0300
committerIlia Abashin <abashinos@gmail.com>2017-08-23 13:17:07 +0300
commit13767be99f8815395be01edc5c97735cdc66590b (patch)
treebbfd7c2176344f1b8f6bc83f5e92f0e91cfaab79 /app/test/fetch/api_fetch/test_api_fetch_availability_zone.py
parent6519f3a2723827b7785fd13690b4c53b28eb325d (diff)
Refactored api fetch tests to use mocked requests
Also fixed some mocking logic Change-Id: I826fc1c03af1244cf10d9edee37c7c8f732c3602 Signed-off-by: Ilia Abashin <abashinos@gmail.com>
Diffstat (limited to 'app/test/fetch/api_fetch/test_api_fetch_availability_zone.py')
-rw-r--r--app/test/fetch/api_fetch/test_api_fetch_availability_zone.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/test/fetch/api_fetch/test_api_fetch_availability_zone.py b/app/test/fetch/api_fetch/test_api_fetch_availability_zone.py
index f32be36..8314854 100644
--- a/app/test/fetch/api_fetch/test_api_fetch_availability_zone.py
+++ b/app/test/fetch/api_fetch/test_api_fetch_availability_zone.py
@@ -17,8 +17,12 @@ from test.fetch.api_fetch.test_data.token import TOKEN
class TestApiFetchAvailabilityZones(TestFetch):
def setUp(self):
+ super().setUp()
self.configure_environment()
+
+ self._v2_auth_pwd = ApiFetchAvailabilityZones.v2_auth_pwd
ApiFetchAvailabilityZones.v2_auth_pwd = MagicMock(return_value=TOKEN)
+
self.fetcher = ApiFetchAvailabilityZones()
self.set_regions_for_fetcher(self.fetcher)
@@ -70,3 +74,8 @@ class TestApiFetchAvailabilityZones(TestFetch):
result = self.fetcher.get(PROJECT)
self.fetcher.v2_auth_pwd = MagicMock(return_value=TOKEN)
self.assertEqual(result, [], "Can't get [] when the token is invalid")
+
+ def tearDown(self):
+ super().tearDown()
+ ApiFetchAvailabilityZones.v2_auth_pwd = self._v2_auth_pwd
+ self.reset_regions_for_fetcher(self.fetcher)