Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/cli/test_client.py
Show First 20 Lines • Show All 595 Lines • ▼ Show 20 Lines | |||||
def test_cli_update_metadata_with_swhid_on_other_status_deposit( | def test_cli_update_metadata_with_swhid_on_other_status_deposit( | ||||
datadir, requests_mock_datadir, cli_runner | datadir, requests_mock_datadir, cli_runner | ||||
): | ): | ||||
"""Update new metadata with swhid on other deposit status is not possible | """Update new metadata with swhid on other deposit status is not possible | ||||
""" | """ | ||||
api_url_basename = "deposit.test.updateswhid" | api_url_basename = "deposit.test.updateswhid" | ||||
deposit_id = 321 | deposit_id = 321 | ||||
deposit_status_xml_path = os.path.join( | |||||
datadir, f"https_{api_url_basename}", f"1_test_{deposit_id}_status" | |||||
) | |||||
with open(deposit_status_xml_path, "r") as f: | |||||
deposit_status_xml = f.read() | |||||
expected_deposit_status = dict(parse_xml(deposit_status_xml)) | |||||
assert expected_deposit_status["deposit_status"] != "done" | |||||
# fmt: off | # fmt: off | ||||
result = cli_runner.invoke( | result = cli_runner.invoke( | ||||
cli, | cli, | ||||
[ | [ | ||||
"upload", | "upload", | ||||
"--url", f"https://{api_url_basename}/1", | "--url", f"https://{api_url_basename}/1", | ||||
"--username", TEST_USER["username"], | "--username", TEST_USER["username"], | ||||
Show All 18 Lines |