Example #1
0
    def __init__(self, profile=None, dry_run=False):
        self._config = koji.read_config(profile or 'koji')
        self.dry_run = dry_run

        # In case we run in DRY_RUN mode, we need to initialize
        # _FAKE_TASK_ID to the id of last ODCS builds to have the IDs
        # increasing and unique even between Freshmaker restarts.
        if self.dry_run:
            KojiService._FAKE_TASK_ID = \
                ArtifactBuild.get_lowest_build_id(db.session) - 1
            if KojiService._FAKE_TASK_ID >= 0:
                KojiService._FAKE_TASK_ID = -1
 def test_get_lowest_build_id(self):
     build_id = ArtifactBuild.get_lowest_build_id(db.session)
     self.assertEqual(build_id, -2)