def setUp(self): TempDirMixin.setUp(self) self.dir_orig = self.dir self.dir_master = pjoin(self.dir, 'master') self.dir_slave = pjoin(self.dir, 'slave') ensure_dirs(self.dir_master) ensure_dirs(self.dir_slave) ensure_dirs(pjoin(self.dir_master, 'metadata')) ensure_dirs(pjoin(self.dir_slave, 'metadata')) # silence missing masters warnings with open(pjoin(self.dir_master, 'metadata', 'layout.conf'), 'w') as f: f.write('masters =\n') with open(pjoin(self.dir_slave, 'metadata', 'layout.conf'), 'w') as f: f.write('masters = master\n') self.master_pdir = pjoin(self.dir_master, 'profiles') self.pdir = self.slave_pdir = pjoin(self.dir_slave, 'profiles') ensure_dirs(self.master_pdir) ensure_dirs(self.slave_pdir) # silence missing repo name warnings with open(pjoin(self.master_pdir, 'repo_name'), 'w') as f: f.write('master\n') with open(pjoin(self.slave_pdir, 'repo_name'), 'w') as f: f.write('slave\n') self.dir = self.dir_slave
def setUp(self): TempDirMixin.setUp(self) self.subdir = pjoin(self.dir, 'dir') os.mkdir(self.subdir) f = open(pjoin(self.dir, 'file'), 'w') f.close() os.mkfifo(pjoin(self.dir, 'fifo'))
def setUp(self): TempDirMixin.setUp(self) self.dir_orig = self.dir self.dir_master = pjoin(self.dir, 'master') self.dir_slave = pjoin(self.dir, 'slave') ensure_dirs(self.dir_master) ensure_dirs(self.dir_slave) self.dir = self.dir_slave self.master_pdir = pjoin(self.dir_master, 'profiles') self.pdir = self.slave_pdir = pjoin(self.dir_slave, 'profiles') ensure_dirs(self.master_pdir) ensure_dirs(self.slave_pdir) with open(pjoin(self.master_pdir, 'repo_name'), 'w') as f: f.write('master\n') with open(pjoin(self.slave_pdir, 'repo_name'), 'w') as f: f.write('slave\n') ensure_dirs(pjoin(self.dir_master, 'metadata')) ensure_dirs(pjoin(self.dir_slave, 'metadata')) with open(pjoin(self.dir_master, 'metadata', 'layout.conf'), 'w') as f: f.write('masters =\n') with open(pjoin(self.dir_slave, 'metadata', 'layout.conf'), 'w') as f: f.write('masters = master\n')
def setUp(self): TempDirMixin.setUp(self) self.pdir = pjoin(self.dir, 'profiles') ensure_dirs(self.pdir) # silence missing masters warnings ensure_dirs(pjoin(self.dir, 'metadata')) with open(pjoin(self.dir, 'metadata', 'layout.conf'), 'w') as f: f.write('masters =\n')
def setUp(self): TempDirMixin.setUp(self) for x, mtime in (("eclass1", 100), ("eclass2", 200)): open(pjoin(self.dir, "%s.eclass" % x), "w").close() os.utime(pjoin(self.dir, "%s.eclass" % x), (mtime, mtime)) # insert a crap file to ensure it doesn't grab it. open(pjoin(self.dir, 'foon-eclass'), 'w').close() self.ec = eclass_cache.cache(self.dir) self.ec_locs = {x: self.dir for x in ("eclass1", "eclass2")}
def setUp(self): TempDirMixin.setUp(self) for x, mtime in (("eclass1", 100), ("eclass2", 200)): open(pjoin(self.dir, "%s.eclass" % x), "w") os.utime(pjoin(self.dir, "%s.eclass" % x), (mtime, mtime)) # insert a crap file to ensure it doesn't grab it. open(pjoin(self.dir, 'foon-eclass'), 'w') self.ec = eclass_cache.cache(self.dir) self.ec_locs = dict((x, self.dir) for x in ("eclass1", "eclass2"))
def __init__(self, *args, **kwargs): TempDirMixin.__init__(self, *args, **kwargs) TestCase.__init__(self, *args, **kwargs) # default files self.make_globals = {} load_make_conf(self.make_globals, pjoin(const.CONFIG_PATH, 'make.globals')) self.global_repos_defaults, self.global_repos_conf = load_repos_conf( pjoin(const.CONFIG_PATH, 'repos.conf'))
def __init__(self, *args, **kwargs): TempDirMixin.__init__(self, *args, **kwargs) TestCase.__init__(self, *args, **kwargs) # default files self.make_globals = {} load_make_conf( self.make_globals, pjoin(const.CONFIG_PATH, 'make.globals')) self.global_repos_defaults, self.global_repos_conf = load_repos_conf( pjoin(const.CONFIG_PATH, 'repos.conf'))
def setUp(self): TempDirMixin.setUp(self) self.loc1 = pjoin(self.dir, "stack1") self.loc2 = pjoin(self.dir, "stack2") os.mkdir(self.loc1) open(pjoin(self.loc1, 'eclass1.eclass'), 'w') os.utime(pjoin(self.loc1, 'eclass1.eclass'), (100, 100)) self.ec1 = eclass_cache.cache(self.loc1) os.mkdir(self.loc2) open(pjoin(self.loc2, 'eclass2.eclass'), 'w') os.utime(pjoin(self.loc2, 'eclass2.eclass'), (100, 100)) self.ec2 = eclass_cache.cache(self.loc2) self.ec = eclass_cache.StackedCaches([self.ec1, self.ec2]) self.ec_locs = {"eclass1":self.loc1, "eclass2":self.loc2} # make a shadowed file to verify it's not seen open(pjoin(self.loc2, 'eclass1.eclass'), 'w')
def setUp(self): TempDirMixin.setUp(self) self.loc1 = pjoin(self.dir, "stack1") self.loc2 = pjoin(self.dir, "stack2") os.mkdir(self.loc1) open(pjoin(self.loc1, 'eclass1.eclass'), 'w').close() os.utime(pjoin(self.loc1, 'eclass1.eclass'), (100, 100)) self.ec1 = eclass_cache.cache(self.loc1) os.mkdir(self.loc2) open(pjoin(self.loc2, 'eclass2.eclass'), 'w').close() os.utime(pjoin(self.loc2, 'eclass2.eclass'), (100, 100)) self.ec2 = eclass_cache.cache(self.loc2) self.ec = eclass_cache.StackedCaches([self.ec1, self.ec2]) self.ec_locs = {"eclass1": self.loc1, "eclass2": self.loc2} # make a shadowed file to verify it's not seen open(pjoin(self.loc2, 'eclass1.eclass'), 'w').close()
def setUp(self): TempDirMixin.setUp(self) self.fp = os.path.join(self.dir, "test") self.obj = fetchable(self.fp, chksums=chksums) self.fetcher = base.fetcher()
def tearDown(self): self.dir = self.dir_orig TempDirMixin.tearDown(self)
def setUp(self): TempDirMixin.setUp(self) self.subdir = pjoin(self.dir, 'dir') os.mkdir(self.subdir) touch(pjoin(self.dir, 'file')) os.mkfifo(pjoin(self.dir, 'fifo'))
def setUp(self): self.orig_env = os.environ["PATH"] TempDirMixin.setUp(self) os.environ["PATH"] = ":".join([self.dir] + self.orig_env.split(":"))
def setUp(self): TempDirMixin.setUp(self) self.pdir = pjoin(self.dir, 'profiles') ensure_dirs(self.pdir)
def setUp(self, default=True): TempDirMixin.setUp(self) if default: self.profile = "default" self.mk_profile(self.profile)
def tearDown(self): self.null_file.close() os.environ["PATH"] = self.orig_env TempDirMixin.tearDown(self)
def tearDown(self): os.environ["PATH"] = self.orig_env TempDirMixin.tearDown(self)