コード例 #1
0
ファイル: test_catalog.py プロジェクト: mbentz80/jzigbeercp
 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())
コード例 #2
0
ファイル: test_catalog.py プロジェクト: apetcho/weave
 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
コード例 #3
0
ファイル: test_catalog.py プロジェクト: yikuide/weave
 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
コード例 #4
0
ファイル: test_catalog.py プロジェクト: mbentz80/jzigbeercp
 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
コード例 #5
0
ファイル: test_catalog.py プロジェクト: zanellia/weave
 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())
コード例 #6
0
ファイル: test_catalog.py プロジェクト: zanellia/weave
 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())
コード例 #7
0
ファイル: test_catalog.py プロジェクト: zanellia/weave
 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())
コード例 #8
0
ファイル: test_catalog.py プロジェクト: mbentz80/jzigbeercp
 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())
コード例 #9
0
ファイル: test_catalog.py プロジェクト: mbentz80/jzigbeercp
 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())
コード例 #10
0
ファイル: test_catalog.py プロジェクト: apetcho/weave
 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())
コード例 #11
0
ファイル: test_catalog.py プロジェクト: apetcho/weave
 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())
コード例 #12
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+'*'))
コード例 #13
0
ファイル: weave_test_utils.py プロジェクト: yikuide/weave
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+'*'))