Page MenuHomeSoftware Heritage

scanner: added test for the model
ClosedPublic

Authored by DanSeraf on Mar 11 2020, 2:57 PM.

Details

Summary

model test:

  • addNode: assert each node is correctly added in the tree structure
  • getJsonTree: assert the result is coherent with the data stored in the tree structure

The folder structure in the fixture temp_folder has changed to be used also by the model tests.

Diff Detail

Repository
rDTSCN Code scanner
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/scanner/tests/conftest.py
44–50

Use a code block, or it will have formatting issues in our Sphinx-generated docs

This revision now requires changes to proceed.Mar 12 2020, 2:10 PM
douardda added inline comments.
swh/scanner/tests/conftest.py
41

generates

56

The PosixPath is not needed here (and below):

subfile = root.joinpath('subfile1.txt')

or even:

subfile = root / 'subfile1.txt'
This revision is now accepted and ready to land.Mar 12 2020, 6:36 PM