datadir = '/var/lib/jenkins/workspace/DDEP/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/cli/../data'
requests_mock_datadir = <requests_mock.mocker.Mocker object at 0x7f7cf7d6d5c0>
cli_runner = <click.testing.CliRunner object at 0x7f7cf678d240>
atom_dataset = {'codemeta-sample': '<?xml version="1.0"?>\n <entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:d...ntry>\n', 'entry-data-empty-body': '<?xml version="1.0"?>\n<entry xmlns="http://www.w3.org/2005/Atom"></entry>\n', ...}
tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_cli_metadata_only_deposit0'
def test_cli_metadata_only_deposit_full_metadata_file(
datadir, requests_mock_datadir, cli_runner, atom_dataset, tmp_path,
):
"""Post metadata-only deposit through cli
The metadata file posted by the client already contains the swhid
"""
api_url_basename = "deposit.test.metadataonly"
swhid = "swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea"
metadata = atom_dataset["entry-data-with-swhid"].format(swhid=swhid)
metadata_path = os.path.join(tmp_path, "entry-data-with-swhid.xml")
with open(metadata_path, "w") as m:
m.write(metadata)
expected_deposit_status = {
"deposit_id": "100",
"deposit_status": "done",
"deposit_date": "2020-10-08T13:52:34.509655",
}
assert expected_deposit_status["deposit_status"] == "done"
# fmt: off
result = cli_runner.invoke(
cli,
[
"metadata-only",
"--url", f"https://{api_url_basename}/1",
"--username", TEST_USER["username"],
"--password", TEST_USER["password"],
"--metadata", metadata_path,
"--format", "json",
],
)
# fmt: on
> assert result.exit_code == 0, result.output
E AssertionError:
E assert 1 == 0
E +1
E -0
.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/cli/test_client.py:839: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 23 2022, 1:52 PM