2
from bzrlib import tests
4
from udd import iconfig
6
class TestCaseWithConfig(tests.TestCaseWithTransport):
9
super(TestCaseWithConfig, self).setUp()
10
# Since iconfig states that pkgimport.conf is part of the sources (or a
11
# directory below), we can't directly use this file for testing.
12
# Instead, we override _root_dir to be local to the test
13
self.overrideAttr(iconfig, '_root_dir', self.test_dir)
14
content = 'pi.base_dir=%s\n' % (self.test_dir,)
15
self._set_store_content(iconfig.PkgimportStore(self.get_transport()),
18
def _set_store_content(self, store, content=None):
19
# content may be unicode but the file content should be utf8
20
content = content.encode('utf-8')
21
store._load_from_string(content)
24
def assertTestPathExists(self, relpath):
25
self.assertPathExists(os.path.join(self.test_dir, relpath))