Exemple #1
0
 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())
Exemple #2
0
 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())
Exemple #3
0
 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
Exemple #4
0
 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
Exemple #5
0
 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())
Exemple #6
0
 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())
Exemple #7
0
 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())
Exemple #8
0
 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())
Exemple #9
0
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+'*'))