(self)
| 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() |
nothing calls this directly
no test coverage detected