Page MenuHomeSoftware Heritage

swh.loader.core.utils: Add coverage on utils module
ClosedPublic

Authored by ardumont on Apr 6 2019, 11:09 AM.

Details

Summary

Test clean_dangling_folders which is used by most of the loaders.

Test Plan

tox

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fix pep8 violations

(build failure: I have some setup issues with flake8/codespell i need
to attend to)

Earlier python3 version are not happy with LocalPath so use string instead

Refactor to deal with LocalPath limitations

/me annoyed

Fix dangling variable

(fixed the pre-commit hook)

Make the tests check the folder independently from order

I had a divergence between local testing and the ci's.

(I cannot use tox on my nixos machine right now so i use only pytest)

Drop unneeded sorted instructions and format

ardumont retitled this revision from test_utils: Add coverage on utils module to swh.loader.core.utils: Add coverage on utils module.Apr 6 2019, 11:45 AM
ardumont added a project: Core Loader.

nitpick:

@patch('foo')
def test_bar(foo):
    foo.return_value = 42
    pass # ...

can be replaced by:

@patch('foo', 42)
def test_bar():
    pass # ...
This revision is now accepted and ready to land.Apr 8 2019, 9:59 AM
  • test_utils: Use @patch directly to declare expected behavior
This revision was automatically updated to reflect the committed changes.