sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00\xb9\x8dWT\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1...ytest-0/test_cli_single_minimal_deposi1/tmpv46m9h5m', 'length': 128, 'md5sum': '6a54f8e9df8b5ae9c353db4bca577c01', ...}
slug = 'c703b10d-1027-4e34-a823-8e780901db02'
patched_tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_cli_single_minimal_deposi1'
requests_mock_datadir = <requests_mock.mocker.Mocker object at 0x7f8b88c3cb38>
cli_runner = <click.testing.CliRunner object at 0x7f8b88c3c710>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f8b88c3cbe0>
def test_cli_single_minimal_deposit_with_create_origin(
sample_archive, slug, patched_tmp_path, requests_mock_datadir, cli_runner, caplog,
):
""" This ensure a single deposit upload through the cli is fine, cf.
https://docs.softwareheritage.org/devel/swh-deposit/getting-started.html#single-deposit
""" # noqa
metadata_path = os.path.join(patched_tmp_path, "metadata.xml")
origin = slug
# fmt: off
result = cli_runner.invoke(
cli,
[
"upload",
"--url", "https://deposit.swh.test/1",
"--username", TEST_USER["username"],
"--password", TEST_USER["password"],
"--name", "test-project",
"--archive", sample_archive["path"],
"--author", "Jane Doe",
"--create-origin", origin,
"--metadata-provenance-url", "meta-prov-url",
"--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:324: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 23 2022, 6:46 PM