Skip to content

Commit

Permalink
tests: fix other tests for shutil.which()
Browse files Browse the repository at this point in the history
These tests would only pass if the relevant tools were actually
installed, but we're not running them.
  • Loading branch information
dbungert committed Sep 8, 2023
1 parent f4082a2 commit f997d66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions probert/tests/test_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ async def test_expected_output_vg(self):
assert expected == await get_swap_sizing(device)


@patch('probert.filesystem.shutil.which', new=Mock(return_value='/bin/false'))
class TestFilesystem(IsolatedAsyncioTestCase):
def setUp(self):
self.device = Mock()
Expand Down
3 changes: 2 additions & 1 deletion probert/tests/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

import subprocess
from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch
from unittest.mock import Mock, patch

from probert.os import probe, _parse_osprober, _run_os_prober


@patch('probert.filesystem.shutil.which', new=Mock(return_value='/bin/false'))
class TestOsProber(IsolatedAsyncioTestCase):
def tearDown(self):
_run_os_prober.cache_clear()
Expand Down

0 comments on commit f997d66

Please sign in to comment.