filesystem: fix and futureproof probert unit test

This commit is contained in:
Dan Bungert 2022-05-18 13:47:01 -06:00
parent 95bee59dee
commit 0b1c87d460
1 changed files with 7 additions and 4 deletions

View File

@ -40,15 +40,18 @@ class TestSubiquityControllerFilesystem(TestCase):
run_coro(self.fsc._probe_once(context=None, restricted=True))
self.app.prober.get_storage.assert_called_with({'blockdev'})
def test_probe_defaults(self):
def test_probe_os_prober_false(self):
self.app.opts.use_os_prober = False
run_coro(self.fsc._probe_once(context=None, restricted=False))
self.app.prober.get_storage.assert_called_with({'defaults'})
actual = self.app.prober.get_storage.call_args.args[0]
self.assertTrue({'defaults'} <= actual)
self.assertNotIn('os', actual)
def test_probe_defaults_and_os(self):
def test_probe_os_prober_true(self):
self.app.opts.use_os_prober = True
run_coro(self.fsc._probe_once(context=None, restricted=False))
self.app.prober.get_storage.assert_called_with({'defaults', 'os'})
actual = self.app.prober.get_storage.call_args.args[0]
self.assertTrue({'defaults', 'os'} <= actual)
class TestGuided(TestCase):