def check_user(path): if sys.platform != 'win32': in_path = '~' path = catalog.catalog_path(in_path) d,f = os.path.split(path) assert(d == os.path.expanduser(in_path)) assert(f == catalog.os_dependent_catalog_name())
def get_test_dir(self, erase=0): # make sure tempdir catalog doesn't exist pardir = tempfile.mkdtemp(suffix="cat_test") cat_glob = os.path.join(pardir, catalog.os_dependent_catalog_name() + ".*") cat_files = glob.glob(cat_glob) if erase: for cat_file in cat_files: os.remove(cat_file) return pardir
def get_test_dir(self,erase=0): # make sure tempdir catalog doesn't exist pardir = tempfile.mkdtemp(suffix='cat_test') cat_glob = os.path.join(pardir,catalog.os_dependent_catalog_name()+'.*') cat_files = glob.glob(cat_glob) if erase: for cat_file in cat_files: os.remove(cat_file) return pardir
def get_test_dir(self,erase = 0): # make sure tempdir catalog doesn't exist import tempfile, glob #temp = tempfile.gettempdir() pardir = tempfile.mktemp(suffix='cat_test') if not os.path.exists(pardir): os.mkdir(pardir) cat_glob = os.path.join(pardir,catalog.os_dependent_catalog_name()+'.*') cat_files = glob.glob(cat_glob) if erase: for cat_file in cat_files: os.remove(cat_file) return pardir
def test_user(path): in_path = '~' path = catalog.catalog_path(in_path) d, f = os.path.split(path) assert_(d == os.path.expanduser(in_path)) assert_(f == catalog.os_dependent_catalog_name())
def test_current(self): in_path = '.' path = catalog.catalog_path(in_path) d, f = os.path.split(path) assert_(d == os.path.abspath(in_path)) assert_(f == catalog.os_dependent_catalog_name())
def test_default(self): in_path = catalog.default_dir() path = catalog.catalog_path(in_path) d, f = os.path.split(path) assert_(d == in_path) assert_(f == catalog.os_dependent_catalog_name())
def check_current(self): in_path = '.' path = catalog.catalog_path(in_path) d,f = os.path.split(path) assert(d == os.path.abspath(in_path)) assert(f == catalog.os_dependent_catalog_name())
def check_default(self): in_path = catalog.default_dir() path = catalog.catalog_path(in_path) d,f = os.path.split(path) assert(d == in_path) assert(f == catalog.os_dependent_catalog_name())
def test_user(path): in_path = "~" path = catalog.catalog_path(in_path) d, f = os.path.split(path) assert_(d == os.path.expanduser(in_path)) assert_(f == catalog.os_dependent_catalog_name())
def test_current(self): in_path = "." path = catalog.catalog_path(in_path) d, f = os.path.split(path) assert_(d == os.path.abspath(in_path)) assert_(f == catalog.os_dependent_catalog_name())
def temp_catalog_files(prefix=''): # might need to add some more platform specific catalog file # suffixes to remove. The .pag was recently added for SunOS d = catalog.default_dir() f = catalog.os_dependent_catalog_name() return glob.glob(os.path.join(d,prefix+f+'*'))