From 54c904f80693c3be17721b1a8bf6512b571cbda3 Mon Sep 17 00:00:00 2001 From: shin- Date: Fri, 4 Apr 2014 16:55:01 +0200 Subject: [PATCH] Updated unit tests API version, flake8 fixes --- docker/auth/auth.py | 1 + docker/client.py | 4 +++- tests/fake_api.py | 2 +- tests/integration_test.py | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docker/auth/auth.py b/docker/auth/auth.py index 59fe1a58..d62705f0 100644 --- a/docker/auth/auth.py +++ b/docker/auth/auth.py @@ -91,6 +91,7 @@ def encode_auth(auth_info): return base64.b64encode(auth_info.get('username', '') + b':' + auth_info.get('password', '')) + def decode_auth(auth): if isinstance(auth, six.string_types): auth = auth.encode('ascii') diff --git a/docker/client.py b/docker/client.py index 635ba19d..f17d5c64 100644 --- a/docker/client.py +++ b/docker/client.py @@ -370,7 +370,9 @@ class Client(requests.Session): # Send the full auth configuration (if any exists), since the build # could use any (or all) of the registries. if self._auth_configs: - headers['X-Registry-Config'] = auth.encode_full_header(self._auth_configs) + headers['X-Registry-Config'] = auth.encode_full_header( + self._auth_configs + ) response = self._post( u, diff --git a/tests/fake_api.py b/tests/fake_api.py index 2dbf342b..cc729f5e 100644 --- a/tests/fake_api.py +++ b/tests/fake_api.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -CURRENT_VERSION = 'v1.8' +CURRENT_VERSION = 'v1.9' FAKE_CONTAINER_ID = '3cc2351ab11b' FAKE_IMAGE_ID = 'e9aa60c60128' diff --git a/tests/integration_test.py b/tests/integration_test.py index 174f9419..3265288b 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -760,8 +760,9 @@ class TestBuildWithAuth(BaseTestCase): if self.client._version < 1.9: return - key = 'K4104GON3P4Q6ZUJFZRRC2ZQTBJ5YT0UMZD7TGT7ZVIR8Y05FAH2TJQI6Y90SMIB' - self.client.login('quay+fortesting', key, registry='https://quay.io/v1/', email='') + k = 'K4104GON3P4Q6ZUJFZRRC2ZQTBJ5YT0UMZD7TGT7ZVIR8Y05FAH2TJQI6Y90SMIB' + self.client.login('quay+fortesting', k, registry='https://quay.io/v1/', + email='') script = io.BytesIO('\n'.join([ 'FROM quay.io/quay/teststuff',