Page MenuHomeSoftware Heritage

deposit.api.checks: Add docstring to module
ClosedPublic

Authored by ardumont on Sep 28 2020, 2:14 PM.

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

Build is green

Patch application report for D4063 (id=14343)

Could not rebase; Attempt merge onto 36d6b760f4...

Updating 36d6b760..cc8d1252
Fast-forward
 swh/deposit/api/checks.py                    |  2 ++
 swh/deposit/api/deposit_update.py            | 15 -----------
 swh/deposit/tests/api/test_deposit_atom.py   |  7 +++++
 swh/deposit/tests/api/test_deposit_update.py | 38 ----------------------------
 4 files changed, 9 insertions(+), 53 deletions(-)
Changes applied before test
commit cc8d12524845811345735a00e836f29dea8fac8c
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Sep 28 14:15:48 2020 +0200

    deposit.api.checks: Add docstring to module

commit 87b39c10eea2ae2b4714e330a1b6ca104a3fcf81
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Sep 28 13:57:05 2020 +0200

    test_deposit_atom: Fix incomplete tests
    
    They were all an instance of the same missing SLUG header instead of their
    dedicated perimeters...

commit 7560021ad09a1187c9393ef4b3ffeffb1f0e13cf
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Sep 28 13:18:58 2020 +0200

    deposit_update: Drop the unneeded check on the directory_missing call
    
    We are working with a SWHID generated by the deposit which is already tested in
    another way. This checks is thus redundant.

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

vlorentz added a subscriber: vlorentz.

Should be a little more detailed.

It should explain what it checks, what metadata is concerned, possibly when it's used

This revision now requires changes to proceed.Sep 28 2020, 5:35 PM

Explicit a bit the checks

enough?

This revision is now accepted and ready to land.Sep 28 2020, 6:09 PM

Build is green

Patch application report for D4063 (id=14366)

Could not rebase; Attempt merge onto 87b39c10ee...

Updating 87b39c10..a2830a9b
Fast-forward
 swh/deposit/api/checks.py                          | 13 ++++++--
 swh/deposit/parsers.py                             | 11 ++++++-
 swh/deposit/tests/api/test_deposit_atom.py         | 18 ++++++-----
 swh/deposit/tests/api/test_deposit_binary.py       | 13 ++++++++
 swh/deposit/tests/api/test_deposit_delete.py       |  8 +++++
 .../api/test_deposit_private_read_metadata.py      |  8 -----
 .../api/test_deposit_private_update_status.py      |  5 +++
 swh/deposit/tests/api/test_deposit_update.py       | 37 ++++++++++------------
 swh/deposit/tests/api/test_parser.py               |  4 ---
 .../atom/entry-data-empty-body-no-namespace.xml    |  2 ++
 .../tests/data/atom/entry-data-empty-body.xml      |  2 +-
 swh/deposit/tests/data/atom/entry-data3.xml        |  2 +-
 12 files changed, 78 insertions(+), 45 deletions(-)
 create mode 100644 swh/deposit/tests/data/atom/entry-data-empty-body-no-namespace.xml
Changes applied before test
commit a2830a9b0bc2b6aa4155dae4417a34a0d4a35c75
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Sep 28 14:15:48 2020 +0200

    deposit.api.checks: Add docstring to module

commit 8d4f19a3f3cfeb13728beb666111977d441e6c7d
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Sep 28 17:44:06 2020 +0200

    tests: Explicit the bad request scenario error messages
    
    Multiple existing tests were not properly configured [1] and checking multiple times the same scenario.
    This makes sure this will not happen again.
    
    [1] D4057 D4060

commit b15033d6ce7c4b60cbf0c82c299a0ed322e7e2e7
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Sep 28 16:18:37 2020 +0200

    tests: Ensure all empty body test cases are covered

commit f05480888a317c5cbc181ebdaa8d98e58914cc06
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Sep 28 16:09:59 2020 +0200

    deposit.parsers: Process namespace when using xmltodict.parse
    
    This keeps the existing behavior though by mapping the expanded name to simpler
    namespaces.
    
    This also fixes some test data sample which were not properly defining their
    namespace.
    
    This will allow to deal more properly the empty body case which is incomplete
    right now.

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