mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 17:16:23 +01:00
tests: Fix TestMirrorGroup to load oscrc from fixtures
This commit is contained in:
parent
a5816132c7
commit
7ad815a149
@ -7,12 +7,16 @@ import osc.conf
|
|||||||
import osc.grabber as osc_grabber
|
import osc.grabber as osc_grabber
|
||||||
|
|
||||||
|
|
||||||
|
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), "conf_fixtures")
|
||||||
|
|
||||||
|
|
||||||
class TestMirrorGroup(unittest.TestCase):
|
class TestMirrorGroup(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.tmpdir = tempfile.mkdtemp(prefix='osc_test')
|
self.tmpdir = tempfile.mkdtemp(prefix='osc_test')
|
||||||
# reset the global `config` in preparation for running the tests
|
# reset the global `config` in preparation for running the tests
|
||||||
importlib.reload(osc.conf)
|
importlib.reload(osc.conf)
|
||||||
osc.conf.get_config()
|
oscrc = os.path.join(self._get_fixtures_dir(), "oscrc")
|
||||||
|
osc.conf.get_config(override_conffile=oscrc, override_no_keyring=True)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
# reset the global `config` to avoid impacting tests from other classes
|
# reset the global `config` to avoid impacting tests from other classes
|
||||||
@ -22,6 +26,9 @@ class TestMirrorGroup(unittest.TestCase):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def _get_fixtures_dir(self):
|
||||||
|
return FIXTURES_DIR
|
||||||
|
|
||||||
def test_invalid_scheme(self):
|
def test_invalid_scheme(self):
|
||||||
gr = osc_grabber.OscFileGrabber()
|
gr = osc_grabber.OscFileGrabber()
|
||||||
mg = osc_grabber.OscMirrorGroup(gr, ["container://example.com"])
|
mg = osc_grabber.OscMirrorGroup(gr, ["container://example.com"])
|
||||||
|
Loading…
Reference in New Issue
Block a user