mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-03 18:16:17 +01:00
Move _get_fixture() to OscTestCase class
This commit is contained in:
parent
00956cf13a
commit
1c581fdf2c
@ -223,6 +223,11 @@ class OscTestCase(unittest.TestCase):
|
|||||||
def _get_fixtures_dir(self):
|
def _get_fixtures_dir(self):
|
||||||
raise NotImplementedError('subclasses should implement this method')
|
raise NotImplementedError('subclasses should implement this method')
|
||||||
|
|
||||||
|
def _get_fixture(self, filename):
|
||||||
|
path = os.path.join(self._get_fixtures_dir(), filename)
|
||||||
|
with open(path) as f:
|
||||||
|
return f.read()
|
||||||
|
|
||||||
def _change_to_pkg(self, name):
|
def _change_to_pkg(self, name):
|
||||||
os.chdir(os.path.join(self.tmpdir, 'osctest', name))
|
os.chdir(os.path.join(self.tmpdir, 'osctest', name))
|
||||||
|
|
||||||
|
@ -28,9 +28,6 @@ class TestResults(OscTestCase):
|
|||||||
cli.main(argv=argv)
|
cli.main(argv=argv)
|
||||||
return sys.stdout.getvalue()
|
return sys.stdout.getvalue()
|
||||||
|
|
||||||
def _get_fixture(self, filename):
|
|
||||||
return open(os.path.join(self._get_fixtures_dir(), filename)).read()
|
|
||||||
|
|
||||||
@GET('http://localhost/build/testproject/_result', file='result.xml')
|
@GET('http://localhost/build/testproject/_result', file='result.xml')
|
||||||
def testPrjresults(self):
|
def testPrjresults(self):
|
||||||
out = self._run_osc('prjresults', '--xml', 'testproject')
|
out = self._run_osc('prjresults', '--xml', 'testproject')
|
||||||
|
Loading…
Reference in New Issue
Block a user