def test_utils_validation(self, mock_validate_keys, mock_validate_options, mock_validate_distributor, mock_save): RepoPublishScheduleManager.create(self.repo, self.distributor, 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_get_distributor, mock_save): mock_get_distributor.return_value = {"id": "distributor1"} ret = RepoPublishScheduleManager.create(self.repo, self.distributor, 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, m_dist_qs, m_save): ret = RepoPublishScheduleManager.create( self.repo_id, self.distributor_id, self.options, self.schedule, 3, False ) m_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_distributor, mock_save): mock_get_distributor.return_value = {'id': 'distributor1'} ret = RepoPublishScheduleManager.create(self.repo, self.distributor, 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_distributor, mock_save): RepoPublishScheduleManager.create(self.repo, self.distributor, 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)