def run_failure_test(self, unmount_mock, ismount_mock): """Tear down mount source task failure.""" task = TearDownMountTask(mount_location) with self.assertRaises(SourceTearDownError) as cm: task.run() self.assertEqual(str(cm.exception), "The mount point /some/dir is still in use.") unmount_mock.assert_called_once_with(mount_location) ismount_mock.assert_called_once_with(mount_location)
def _tear_down_additional_sources(self): """Tear down sources of additional repositories. FIXME: This is a temporary workaround. """ while self._mount_points: mount_point = self._mount_points.pop() task = TearDownMountTask(mount_point) task.run()
def test_run_failure(self, unmount_mock, ismount_mock): """Tear down mount source task failure.""" task = TearDownMountTask(mount_location) with pytest.raises(SourceTearDownError) as cm: task.run() assert str(cm.value) == "The mount point /some/dir is still in use." unmount_mock.assert_called_once_with(mount_location) ismount_mock.assert_called_once_with(mount_location)
def run_success_test(self, unmount_mock): """Tear down mount source task execution.""" task = TearDownMountTask(mount_location) task.run() unmount_mock.assert_called_once_with(mount_location)