示例#1
0
    def test_utils_validation(self, mock_validate_keys, mock_validate_options,
                              mock_validate_importer, mock_save):
        RepoSyncScheduleManager.create(self.repo, self.importer, self.options,
                                       self.schedule)

        mock_validate_keys.assert_called_once_with(self.options,
                                                   ('override_config', ))
        mock_validate_options.assert_called_once_with(self.schedule, None,
                                                      True)
示例#2
0
文件: test_repo.py 项目: pcreech/pulp
    def test_save(self, mock_save, *_):
        ret = RepoSyncScheduleManager.create(self.repo, self.importer, self.options, self.schedule, 3, False)

        mock_save.assert_called_once_with()
        self.assertTrue(isinstance(ret, ScheduledCall))
        self.assertEqual(ret.iso_schedule, self.schedule)
        self.assertEqual(ret.failure_threshold, 3)
        self.assertTrue(ret.enabled is False)
示例#3
0
    def test_save(self, mock_get_importer, mock_save):
        mock_get_importer.return_value = {'id': 'importer1'}

        ret = RepoSyncScheduleManager.create(self.repo, self.importer, self.options,
                                             self.schedule, 3, False)

        mock_save.assert_called_once_with()
        self.assertTrue(isinstance(ret, ScheduledCall))
        self.assertEqual(ret.iso_schedule, self.schedule)
        self.assertEqual(ret.failure_threshold, 3)
        self.assertTrue(ret.enabled is False)
示例#4
0
    def test_utils_validation(self, mock_validate_keys, mock_validate_options, mock_validate_importer, mock_save):
        RepoSyncScheduleManager.create(self.repo, self.importer, self.options, self.schedule)

        mock_validate_keys.assert_called_once_with(self.options, ("override_config",))
        mock_validate_options.assert_called_once_with(self.schedule, None, True)