Skip to content

Commit

Permalink
Dont require gpg pass when running tests (BugFix) (#843)
Browse files Browse the repository at this point in the history
properly mock subprocess calls in test_provider_manager

Previously when the tests run, if the host had a GPG key in its databse
that was protected by a password, the operator was asked to provide the
password. This was due to subprocess.call not being mocked properly in
the provider_manager tests.

This patch adds the mocking.
  • Loading branch information
kissiel authored Nov 27, 2023
1 parent 16da765 commit c7a63a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions checkbox-ng/plainbox/test_provider_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ def test_sdist(self):
"""
verify that ``sdist`` creates a proper tarball
"""
self.tool.main(["sdist"])
with mock.patch('subprocess.call'):
self.tool.main(["sdist"])
tarball = os.path.join(
self.tmpdir, "dist", "com.example.test-1.0.tar.gz")
self.assertTarballContent(
Expand All @@ -259,7 +260,8 @@ def test_sdist__partial(self):
even if some files are missing
"""
shutil.rmtree(os.path.join(self.tmpdir, "jobs"))
self.tool.main(["sdist"])
with mock.patch('subprocess.call'):
self.tool.main(["sdist"])
tarball = os.path.join(
self.tmpdir, "dist", "com.example.test-1.0.tar.gz")
self.assertNoTarballContent(
Expand Down

0 comments on commit c7a63a1

Please sign in to comment.