def test_liberate(writer_stock): with pytest.raises(PermissionError): StockRoom(enable_write=True) runner = CliRunner() res = runner.invoke(cli.liberate) assert res.exit_code == 0 stock = StockRoom(enable_write=True) stock.close()
def test_commit(repo_with_col): runner = CliRunner() stock = StockRoom(enable_write=True) stock.experiment["key"] = "value" stock.close() res = runner.invoke(cli.commit, []) assert "Error: Require commit message\n" in res.stdout res = runner.invoke(cli.commit, ["-m", "test commit"]) assert res.exit_code == 0 assert "Commit message:\ntest commit" in res.stdout assert "Commit Successful. Digest" in res.stdout stock._repo._env._close_environments()
def test_commit(repo_with_col): runner = CliRunner() stock = StockRoom(write=True) stock.experiment['key'] = 'value' stock.close() res = runner.invoke(cli.commit, []) assert 'Error: Require commit message\n' in res.stdout res = runner.invoke(cli.commit, ['-m', 'test commit']) assert res.exit_code == 0 assert 'Commit message:\ntest commit' in res.stdout assert 'Commit Successful. Digest' in res.stdout stock._repo._env._close_environments()