Page MenuHomeSoftware Heritage

test_client: Add scenario on deposit status cli
ClosedPublic

Authored by ardumont on Oct 9 2020, 1:49 PM.

Details

Summary

This also checks the 3 different format outputs which were not so far.

Test Plan

tox

Diff Detail

Repository
rDDEP Push deposit
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Update xml status file to be consistent with url used

Build is green

Patch application report for D4219 (id=14879)

Could not rebase; Attempt merge onto af8381f853...

Updating af8381f8..c39c096e
Fast-forward
 swh/deposit/tests/cli/test_client.py               | 324 +++++++++++----------
 .../https_deposit.test.metadata/1_servicedocument  |  26 ++
 .../tests/data/https_deposit.test.metadata/1_test  |  19 ++
 .../1_test_666_metadata                            |  19 ++
 .../https_deposit.test.metadata/1_test_666_status  |   8 +
 .../https_deposit.test.status/1_servicedocument    |  26 ++
 .../https_deposit.test.status/1_test_1033_status   |  10 +
 7 files changed, 272 insertions(+), 160 deletions(-)
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_metadata
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_status
 create mode 100644 swh/deposit/tests/data/https_deposit.test.status/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.status/1_test_1033_status
Changes applied before test
commit c39c096e208b3e67df883eeda1d5909c83c99209
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 13:48:49 2020 +0200

    test_client: Add scenario on deposit status cli
    
    This also checks the 3 different format outputs which were not so far.

commit 24d3fd90a7d925f336cac9a836c5c4e1c60929c7
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 12:17:58 2020 +0200

    test_client: Refactor and simplify tests for a better readability
    
    This:
    - Align all tests to use json format so the output check is simpler
    - Simplify the failure cases to check the caplog record
    - Drop dead code
    - Rename tests with a `test_cli_` prefix so it's simpler to run separately from
    the rest

commit b18cd89d4c507709973721c47d49ffff7c856763
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 11:52:37 2020 +0200

    test_client: Migrate multisteps_deposit scenario to use requests_mock_datadir
    
    Instead of mock.
    
    Note that right now, we should be using requests_mock_datadir_visits so we can
    leverage a second visit with the correct status. But this refused to work so
    far. A FIXME has been added to deal with this soon.

commit 0d71b43ad3d86f3ca8065bb5e19cbc07e8abcfd4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 8 19:32:30 2020 +0200

    test_client: Migrate slug generation scenario to use requests_mock_datadir
    
    instead of mock

commit c377c3b66c3fcfc1093fd2f8f997ef487beebe7a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 8 19:22:46 2020 +0200

    test_client: Migrate metadata validation scenario to use requests_mock_datadir
    
    instead of mock

See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/195/ for more details.

Build is green

Patch application report for D4219 (id=14881)

Could not rebase; Attempt merge onto af8381f853...

Updating af8381f8..b0970e4d
Fast-forward
 swh/deposit/tests/cli/test_client.py               | 324 +++++++++++----------
 .../https_deposit.test.metadata/1_servicedocument  |  26 ++
 .../tests/data/https_deposit.test.metadata/1_test  |  19 ++
 .../1_test_666_metadata                            |  19 ++
 .../https_deposit.test.metadata/1_test_666_status  |   8 +
 .../https_deposit.test.status/1_servicedocument    |  26 ++
 .../https_deposit.test.status/1_test_1033_status   |  10 +
 7 files changed, 272 insertions(+), 160 deletions(-)
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_metadata
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_status
 create mode 100644 swh/deposit/tests/data/https_deposit.test.status/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.status/1_test_1033_status
Changes applied before test
commit b0970e4de7d1197a622956cc087caad5407d1a04
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 13:48:49 2020 +0200

    test_client: Add scenario on deposit status cli
    
    This also checks the 3 different format outputs which were not so far.

commit 24d3fd90a7d925f336cac9a836c5c4e1c60929c7
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 12:17:58 2020 +0200

    test_client: Refactor and simplify tests for a better readability
    
    This:
    - Align all tests to use json format so the output check is simpler
    - Simplify the failure cases to check the caplog record
    - Drop dead code
    - Rename tests with a `test_cli_` prefix so it's simpler to run separately from
    the rest

commit b18cd89d4c507709973721c47d49ffff7c856763
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 11:52:37 2020 +0200

    test_client: Migrate multisteps_deposit scenario to use requests_mock_datadir
    
    Instead of mock.
    
    Note that right now, we should be using requests_mock_datadir_visits so we can
    leverage a second visit with the correct status. But this refused to work so
    far. A FIXME has been added to deal with this soon.

commit 0d71b43ad3d86f3ca8065bb5e19cbc07e8abcfd4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 8 19:32:30 2020 +0200

    test_client: Migrate slug generation scenario to use requests_mock_datadir
    
    instead of mock

commit c377c3b66c3fcfc1093fd2f8f997ef487beebe7a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 8 19:22:46 2020 +0200

    test_client: Migrate metadata validation scenario to use requests_mock_datadir
    
    instead of mock

See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/196/ for more details.

vlorentz added inline comments.
swh/deposit/tests/cli/test_client.py
438

I don't understand this sentence

swh/deposit/tests/cli/test_client.py
438

neither can i

Rework docstring sentence

swh/deposit/tests/cli/test_client.py
438

neither do* i, i've fixed it.

Build is green

Patch application report for D4219 (id=14892)

Could not rebase; Attempt merge onto af8381f853...

Updating af8381f8..113f495f
Fast-forward
 swh/deposit/tests/cli/test_client.py               | 324 +++++++++++----------
 .../https_deposit.test.metadata/1_servicedocument  |  26 ++
 .../tests/data/https_deposit.test.metadata/1_test  |  19 ++
 .../1_test_666_metadata                            |  19 ++
 .../https_deposit.test.metadata/1_test_666_status  |   8 +
 .../https_deposit.test.status/1_servicedocument    |  26 ++
 .../https_deposit.test.status/1_test_1033_status   |  10 +
 7 files changed, 272 insertions(+), 160 deletions(-)
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_metadata
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_status
 create mode 100644 swh/deposit/tests/data/https_deposit.test.status/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.status/1_test_1033_status
Changes applied before test
commit 113f495fc9cabf86f56e8c9c5763b2e2453b4246
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 13:48:49 2020 +0200

    test_client: Add scenario on deposit status cli
    
    This also checks the 3 different format outputs which were not so far.

commit 24d3fd90a7d925f336cac9a836c5c4e1c60929c7
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 12:17:58 2020 +0200

    test_client: Refactor and simplify tests for a better readability
    
    This:
    - Align all tests to use json format so the output check is simpler
    - Simplify the failure cases to check the caplog record
    - Drop dead code
    - Rename tests with a `test_cli_` prefix so it's simpler to run separately from
    the rest

commit b18cd89d4c507709973721c47d49ffff7c856763
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 11:52:37 2020 +0200

    test_client: Migrate multisteps_deposit scenario to use requests_mock_datadir
    
    Instead of mock.
    
    Note that right now, we should be using requests_mock_datadir_visits so we can
    leverage a second visit with the correct status. But this refused to work so
    far. A FIXME has been added to deal with this soon.

commit 0d71b43ad3d86f3ca8065bb5e19cbc07e8abcfd4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 8 19:32:30 2020 +0200

    test_client: Migrate slug generation scenario to use requests_mock_datadir
    
    instead of mock

commit c377c3b66c3fcfc1093fd2f8f997ef487beebe7a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 8 19:22:46 2020 +0200

    test_client: Migrate metadata validation scenario to use requests_mock_datadir
    
    instead of mock

See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/197/ for more details.

Build is green

Patch application report for D4219 (id=14894)

Could not rebase; Attempt merge onto af8381f853...

Updating af8381f8..1a782449
Fast-forward
 swh/deposit/tests/cli/test_client.py               | 324 +++++++++++----------
 .../https_deposit.test.metadata/1_servicedocument  |  26 ++
 .../tests/data/https_deposit.test.metadata/1_test  |  19 ++
 .../1_test_666_metadata                            |  19 ++
 .../https_deposit.test.metadata/1_test_666_status  |   8 +
 .../https_deposit.test.status/1_servicedocument    |  26 ++
 .../https_deposit.test.status/1_test_1033_status   |  10 +
 7 files changed, 272 insertions(+), 160 deletions(-)
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_metadata
 create mode 100644 swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_status
 create mode 100644 swh/deposit/tests/data/https_deposit.test.status/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.status/1_test_1033_status
Changes applied before test
commit 1a782449064a4228af12ad768862611cc5a49a69
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 13:48:49 2020 +0200

    test_client: Add scenario on deposit status cli
    
    This also checks the 3 different format outputs which were not so far.

commit 404f2728ad0f85789b0827025eafb1c8b6124c05
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 12:17:58 2020 +0200

    test_client: Refactor and simplify tests for a better readability
    
    This:
    - Align all tests to use json format so the output check is simpler
    - Simplify the failure cases to check the caplog record
    - Drop dead code
    - Rename tests with a `test_cli_` prefix so it's simpler to run separately from
    the rest

commit b18cd89d4c507709973721c47d49ffff7c856763
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 9 11:52:37 2020 +0200

    test_client: Migrate multisteps_deposit scenario to use requests_mock_datadir
    
    Instead of mock.
    
    Note that right now, we should be using requests_mock_datadir_visits so we can
    leverage a second visit with the correct status. But this refused to work so
    far. A FIXME has been added to deal with this soon.

commit 0d71b43ad3d86f3ca8065bb5e19cbc07e8abcfd4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 8 19:32:30 2020 +0200

    test_client: Migrate slug generation scenario to use requests_mock_datadir
    
    instead of mock

commit c377c3b66c3fcfc1093fd2f8f997ef487beebe7a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 8 19:22:46 2020 +0200

    test_client: Migrate metadata validation scenario to use requests_mock_datadir
    
    instead of mock

See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/199/ for more details.

moranegg added a subscriber: moranegg.

Accepting cause the comment is only to improve the docstring

swh/deposit/tests/cli/test_client.py
438

maybe adding in (e.g ) the possible output formats?
and if it's a success test or a failure test

This revision is now accepted and ready to land.Oct 9 2020, 4:01 PM
swh/deposit/tests/cli/test_client.py
438

ok ;)

swh/deposit/tests/cli/test_client.py
438