#4461 unit test mocking fixes for test_download_file and test_list_tagged
Merged by mikem. Opened by mikem.
mikem/koji more-unittest-fixes  into  master

Download 4461.patch

These changes catch a few more intermittent test failures.

test_download_file was mocking the builtin open, which could in some cases break the test depending on test order. Adjusted the test to avoid using the mock.

test_list_tagged was mocking some os.path functions, which could break optparse calls in some cases, depending on test order. In particular, running test_list_tagged.py::TestCliListTagged::test_list_tagged_sigs_paths by itself would fail.

Fixes https://pagure.io/koji/issue/4462

rebased onto a2d2e35dc1764b508d601289265e2fc92152dde3

2 new commits added

  • fix fallout
  • also mock BASEDIR

Looks good now @mikem Thank you for fixing these!

I approve this PR.

Metadata Update from @mikem:
- Pull-request tagged with: no_qe

Commit 39997286 fixes this pull-request

Pull-Request has been merged by mikem

Metadata