def test_get_supported_filesystems(self, mock_os, mock_util): """ test parsing /proc/filesystems contents into a filesystem list""" mock_os.path.exists.return_value = True mock_util.load_file.return_value = self._proc_filesystems_output() result = block.get_supported_filesystems() self.assertEqual(sorted(self.supported_filesystems), sorted(result))
def test_get_supported_filesystems_no_proc_path(self, mock_os, mock_util): """ missing /proc/filesystems raises RuntimeError """ mock_os.path.exists.return_value = False with self.assertRaises(RuntimeError): block.get_supported_filesystems() self.assertEqual(0, mock_util.load_file.call_count)