summaryrefslogtreecommitdiff
path: root/tests/unit/auth_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/auth_test.py')
-rw-r--r--tests/unit/auth_test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/auth_test.py b/tests/unit/auth_test.py
index d6981cd..ee32ca0 100644
--- a/tests/unit/auth_test.py
+++ b/tests/unit/auth_test.py
@@ -210,6 +210,19 @@ class ResolveAuthTest(unittest.TestCase):
self.auth_config, auth.resolve_repository_name(image)[0]
) is None
+ def test_resolve_auth_with_empty_credstore_and_auth_dict(self):
+ auth_config = {
+ 'auths': auth.parse_auth({
+ 'https://index.docker.io/v1/': self.index_config,
+ }),
+ 'credsStore': 'blackbox'
+ }
+ with mock.patch('docker.auth._resolve_authconfig_credstore') as m:
+ m.return_value = None
+ assert 'indexuser' == auth.resolve_authconfig(
+ auth_config, None
+ )['username']
+
class CredStoreTest(unittest.TestCase):
def test_get_credential_store(self):