diff options
Diffstat (limited to 'macaroonbakery/tests/test_client.py')
-rw-r--r-- | macaroonbakery/tests/test_client.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/macaroonbakery/tests/test_client.py b/macaroonbakery/tests/test_client.py index 2ae08d3..6437a54 100644 --- a/macaroonbakery/tests/test_client.py +++ b/macaroonbakery/tests/test_client.py @@ -3,9 +3,7 @@ import base64 import datetime import json -import os import threading -from unittest import TestCase import macaroonbakery.bakery as bakery import macaroonbakery.checkers as checkers @@ -14,6 +12,10 @@ import pymacaroons import requests import macaroonbakery._utils as utils +from fixtures import ( + EnvironmentVariable, + TestWithFixtures, +) from httmock import HTTMock, urlmatch from six.moves.urllib.parse import parse_qs from six.moves.urllib.request import Request @@ -27,12 +29,13 @@ AGES = datetime.datetime.utcnow() + datetime.timedelta(days=1) TEST_OP = bakery.Op(entity='test', action='test') -class TestClient(TestCase): +class TestClient(TestWithFixtures): def setUp(self): super(TestClient, self).setUp() # http_proxy would cause requests to talk to the proxy, which is # unlikely to know how to talk to the test server. - os.environ.pop('http_proxy', None) + self.useFixture(EnvironmentVariable('http_proxy')) + self.useFixture(EnvironmentVariable('HTTP_PROXY')) def test_single_service_first_party(self): b = new_bakery('loc', None, None) |