1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

- def setUp: added "copytree" parameter to disable the copy of the "osctest" dir

This commit is contained in:
Marcus Huewe 2010-12-30 01:57:41 +01:00
parent 01fc46cbd3
commit b99a903873

View File

@ -105,9 +105,10 @@ def addExpectedRequest(method, url, **kwargs):
EXPECTED_REQUESTS.append((method, url, kwargs)) EXPECTED_REQUESTS.append((method, url, kwargs))
class OscTestCase(unittest.TestCase): class OscTestCase(unittest.TestCase):
def setUp(self): def setUp(self, copytree=True):
osc.core.conf.get_config(override_conffile=os.path.join(self._get_fixtures_dir(), 'oscrc')) osc.core.conf.get_config(override_conffile=os.path.join(self._get_fixtures_dir(), 'oscrc'))
self.tmpdir = tempfile.mkdtemp(prefix='osc_test') self.tmpdir = tempfile.mkdtemp(prefix='osc_test')
if copytree:
shutil.copytree(os.path.join(self._get_fixtures_dir(), 'osctest'), os.path.join(self.tmpdir, 'osctest')) shutil.copytree(os.path.join(self._get_fixtures_dir(), 'osctest'), os.path.join(self.tmpdir, 'osctest'))
global EXPECTED_REQUESTS global EXPECTED_REQUESTS
EXPECTED_REQUESTS = [] EXPECTED_REQUESTS = []