def test_check_raises_errors(
            self, calculate_free_space_mock, find_mount_point_mock):

        checker = CheckFreeSpace(self.context)
        err_msg = "Not enough free space on device: " +\
            "device /etc (required 10MB, available 9MB, not enough 1MB), " +\
            "device /var (required 20MB, available 9MB, not enough 11MB)"

        with self.assertRaises(errors.NotEnoughFreeSpaceOnDeviceError) as exc:
            checker.check()

        self.assertEqual(str(exc.exception), err_msg)
        self.called_times(find_mount_point_mock, 3)
        self.called_times(calculate_free_space_mock, 2)
Esempio n. 2
0
    def test_check_raises_errors(self, calculate_free_space_mock,
                                 find_mount_point_mock):

        checker = CheckFreeSpace(self.context)
        err_msg = "Not enough free space on device: " +\
            "device /etc (required 10MB, available 9MB, not enough 1MB), " +\
            "device /var (required 20MB, available 9MB, not enough 11MB)"

        with self.assertRaises(errors.NotEnoughFreeSpaceOnDeviceError) as exc:
            checker.check()

        self.assertEqual(str(exc.exception), err_msg)
        self.called_times(find_mount_point_mock, 3)
        self.called_times(calculate_free_space_mock, 2)
    def test_check(self, calculate_free_space_mock, find_mount_point_mock):
        checker = CheckFreeSpace(self.context)
        checker.check()

        self.called_times(find_mount_point_mock, 3)
        self.called_times(calculate_free_space_mock, 2)
Esempio n. 4
0
    def test_check(self, calculate_free_space_mock, find_mount_point_mock):
        checker = CheckFreeSpace(self.context)
        checker.check()

        self.called_times(find_mount_point_mock, 3)
        self.called_times(calculate_free_space_mock, 2)