def test_init_new_login(runner, empty_netrc, local_netrc, request_mocker, query_projects, query_viewer):
query_viewer(request_mocker)
query_projects(request_mocker)
with runner.isolated_filesystem():
# If the test was run from a directory containing .wandb, then __stage_dir__
# was '.wandb' when imported by api.py, reload to fix. UGH!
reload(wandb)
result = runner.invoke(cli.init, input="%s\nvanpelt" % DUMMY_API_KEY)
print('Output: ', result.output)
print('Exception: ', result.exception)
print('Traceback: ', traceback.print_tb(result.exc_info[2]))
assert result.exit_code == 0
with open("netrc", "r") as f:
generatedNetrc = f.read()
with open("wandb/settings", "r") as f:
generatedWandb = f.read()
assert DUMMY_API_KEY in generatedNetrc
assert "test_model" in generatedWandb
评论列表
文章目录