sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00\xfcvWT\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1som...s/pytest-0/test_cli_multisteps_deposit0/tmplqu6s8uw', 'length': 128, 'md5sum': '2b21e27532baa1765a051c7af81b730b', ...}
datadir = '/var/lib/jenkins/workspace/DDEP/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/cli/../data'
slug = 'e4250557-c076-4132-9896-a8bea16889aa'
requests_mock_datadir = <requests_mock.mocker.Mocker object at 0x7fb007348cc0>
cli_runner = <click.testing.CliRunner object at 0x7fb007348b38>
def test_cli_multisteps_deposit(
sample_archive, datadir, slug, requests_mock_datadir, cli_runner
):
""" First deposit a partial deposit (no metadata, only archive), then update the metadata part.
https://docs.softwareheritage.org/devel/swh-deposit/getting-started.html#multisteps-deposit
""" # noqa
api_url = "https://deposit.test.metadata/1"
deposit_id = 666
# Create a partial deposit with only 1 archive
# fmt: off
result = cli_runner.invoke(
cli,
[
"upload",
"--url", api_url,
"--username", TEST_USER["username"],
"--password", TEST_USER["password"],
"--archive", sample_archive["path"],
"--slug", slug,
"--format", "json",
"--partial",
],
)
# fmt: on
> assert result.exit_code == 0, f"unexpected output: {result.output}"
E AssertionError: unexpected output:
E assert 1 == 0
E +1
E -0
.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/cli/test_client.py:603: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 23 2022, 3:56 PM