From ee7a86c03f661fe6a0ce3c0792ff884d6f91b185 Mon Sep 17 00:00:00 2001 From: Michael Krotscheck Date: Thu, 26 Feb 2015 11:07:45 -0800 Subject: [PATCH] Reduce the number of timezones under test. OAuth was testing all timezones. This is overkill, and caused some of our tests to intermittently time out. This reduces the test timezone set to the GMT range, which should provide reasonable test coverage. Change-Id: I4f37edb37d64644fc1f14b0e97b75ac95d3b68df --- storyboard/tests/api/auth/test_oauth.py | 36 +++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/storyboard/tests/api/auth/test_oauth.py b/storyboard/tests/api/auth/test_oauth.py index 7ec2a042..49038059 100644 --- a/storyboard/tests/api/auth/test_oauth.py +++ b/storyboard/tests/api/auth/test_oauth.py @@ -504,6 +504,38 @@ class TestOAuthAccessToken(BaseOAuthTest): access tokens. """ + tested_timezones = [ + 'Etc/GMT', + 'Etc/GMT+0', + 'Etc/GMT+1', + 'Etc/GMT+10', + 'Etc/GMT+11', + 'Etc/GMT+12', + 'Etc/GMT+2', + 'Etc/GMT+3', + 'Etc/GMT+4', + 'Etc/GMT+5', + 'Etc/GMT+6', + 'Etc/GMT+7', + 'Etc/GMT+8', + 'Etc/GMT+9', + 'Etc/GMT-0', + 'Etc/GMT-1', + 'Etc/GMT-10', + 'Etc/GMT-11', + 'Etc/GMT-12', + 'Etc/GMT-13', + 'Etc/GMT-14', + 'Etc/GMT-2', + 'Etc/GMT-3', + 'Etc/GMT-4', + 'Etc/GMT-5', + 'Etc/GMT-6', + 'Etc/GMT-7', + 'Etc/GMT-8', + 'Etc/GMT-9', + ] + def test_valid_access_request(self): """This test ensures that the access token request may execute properly with a valid token. @@ -577,7 +609,7 @@ class TestOAuthAccessToken(BaseOAuthTest): old_tz = os.environ['TZ'] # Convert now into every possible timezone out there :) - for name in pytz.all_timezones: + for name in self.tested_timezones: # Override the 'default timezone' for the current runtime. os.environ['TZ'] = name @@ -623,7 +655,7 @@ class TestOAuthAccessToken(BaseOAuthTest): old_tz = os.environ['TZ'] # Convert now into every possible timezone out there :) - for name in pytz.all_timezones: + for name in self.tested_timezones: # Override the 'default timezone' for the current runtime. os.environ['TZ'] = name