unit test

This commit is contained in:
Mike McLean 2025-01-03 11:44:06 -05:00 committed by Tomas Kopecek
parent 109a5e7f21
commit a927e0b12c

View file

@ -93,6 +93,19 @@ class TestRepoWatcher(unittest.TestCase):
args = watcher.task_args()
params = koji.tasks.parse_task_params('waitrepo', args)
def test_getRepo_task_req(self):
# make sure task_args reports expected min_event
req = {'id': 999, 'min_event': 54321}
self.session.repo.request.return_value = {'repo': None, 'request': req}
watcher = RepoWatcher(self.session, self.TAG)
result = watcher.getRepo()
self.assertEqual(result, None)
args = watcher.task_args()
# [tag, newer_than, nvrs, min_event]
expected = ['MY-TAG', None, [], 54321]
self.assertEqual(args, expected)
def test_waitrepo_build_wait(self):
self.session.repo.get.return_value = None
# we'll pass with nvrs, so we should wait for builds before making request