openSUSE-release-tools/tests/unselect_tests.py
Jimmy Berry 760ddf39e6 osclib/conf: decouple from StagingAPI and always fetch remote config.
As the remote config is no longer optional for SLE and is utilized by
openSUSE to the point were it is dangerous not to load the remote config
it should be required. Currently only certain users call apply_remote()
while this will make it built-in during construction and thus makes the
usage consistent and no longer require StagingAPI.
2018-08-16 21:53:40 -05:00

25 lines
877 B
Python

import unittest
from osclib.conf import Config
from osclib.stagingapi import StagingAPI
from osclib.unselect_command import UnselectCommand
from obs import APIURL
from obs import PROJECT
from obs import OBS
class TestUnselect(unittest.TestCase):
def setUp(self):
self.obs = OBS()
Config(APIURL, PROJECT)
self.api = StagingAPI(APIURL, PROJECT)
def test_cleanup_filter(self):
UnselectCommand.config_init(self.api)
obsolete = self.api.project_status_requests('obsolete', UnselectCommand.filter_obsolete)
self.assertTrue('492438' in obsolete, 'revoked')
self.assertTrue('592437' in obsolete, 'superseded but over threshold')
self.assertTrue('492439' in obsolete, 'declined by leaper')
self.assertTrue('492441' in obsolete, 'declined but over threshold')
self.assertEqual(len(obsolete), 4)