diff --git a/tests/common.py b/tests/common.py index 82a88648..0cb5c200 100644 --- a/tests/common.py +++ b/tests/common.py @@ -223,6 +223,11 @@ class OscTestCase(unittest.TestCase): def _get_fixtures_dir(self): 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): os.chdir(os.path.join(self.tmpdir, 'osctest', name)) diff --git a/tests/test_results.py b/tests/test_results.py index cbfa60a9..7269c7e7 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -28,9 +28,6 @@ class TestResults(OscTestCase): cli.main(argv=argv) 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') def testPrjresults(self): out = self._run_osc('prjresults', '--xml', 'testproject')