sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00xGXT\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1some c...ytest-0/test_cli_single_minimal_deposi0/tmp6p_q7_2z', 'length': 128, 'md5sum': '393247a8a8f82963c43949505a08f520', ...}
slug = '2a5f2564-0b68-4600-b9f5-0f51cf552af8'
patched_tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_cli_single_minimal_deposi0'
requests_mock_datadir = <requests_mock.mocker.Mocker object at 0x7f021bbc7588>
cli_runner = <click.testing.CliRunner object at 0x7f021a9c9080>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f021a9c9780>
def test_cli_single_minimal_deposit_with_slug(
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")
# 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"],
"--metadata-provenance-url", "meta-prov-url",
"--author", "Jane Doe",
"--slug", slug,
"--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:267: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 24 2022, 10:00 AM