def test_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 test_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 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 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 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+'*'))