MCPcopy Index your code
hub / github.com/docker/docker-py / test_load_legacy_config

Method test_load_legacy_config

tests/unit/auth_test.py:231–247  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

229 assert cfg is not None
230
231 def test_load_legacy_config(self):
232 folder = tempfile.mkdtemp()
233 self.addCleanup(shutil.rmtree, folder)
234 cfg_path = os.path.join(folder, '.dockercfg')
235 auth_ = base64.b64encode(b'sakuya:izayoi').decode('ascii')
236 with open(cfg_path, 'w') as f:
237 f.write(f'auth = {auth_}\n')
238 f.write('email = sakuya@scarlet.net')
239
240 cfg = auth.load_config(cfg_path)
241 assert auth.resolve_authconfig(cfg) is not None
242 assert cfg.auths[auth.INDEX_NAME] is not None
243 cfg = cfg.auths[auth.INDEX_NAME]
244 assert cfg['username'] == 'sakuya'
245 assert cfg['password'] == 'izayoi'
246 assert cfg['email'] == 'sakuya@scarlet.net'
247 assert cfg.get('Auth') is None
248
249 def test_load_json_config(self):
250 folder = tempfile.mkdtemp()

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
load_configMethod · 0.80
resolve_authconfigMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected