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)
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)
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)
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)