本文整理匯總了Python中server.FILES類的典型用法代碼示例。如果您正苦於以下問題:Python FILES類的具體用法?Python FILES怎麽用?Python FILES使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FILES類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_tree
def test_get_tree(self):
"""
Download entire tree
"""
with hide("everything"):
get("tree", self.tmpdir)
leaves = list(filter(lambda x: x[0].startswith("/tree"), FILES.items()))
for path, contents in leaves:
eq_contents(self.path(path[1:]), contents)
示例2: test_get_tree
def test_get_tree(self):
"""
Download entire tree
"""
with hide('everything'):
get('tree', self.tmpdir)
leaves = filter(lambda x: x[0].startswith('/tree'), FILES.items())
for path, contents in leaves:
eq_contents(self.path(path[1:]), contents)
示例3: test_get_tree
def test_get_tree(self):
"""
Download entire tree
"""
with hide('everything'):
get('tree', self.tmpdir)
leaves = [x for x in list(FILES.items()) if x[0].startswith('/tree')]
for path, contents in leaves:
eq_contents(self.path(path[1:]), contents)
示例4: test_get_tree_with_implicit_local_path
def test_get_tree_with_implicit_local_path(self):
"""
Download entire tree without specifying a local path
"""
dirname = env.host_string.replace(':', '-')
try:
with hide('everything'):
get('tree')
leaves = filter(lambda x: x[0].startswith('/tree'), FILES.items())
for path, contents in leaves:
path = os.path.join(dirname, path[1:])
eq_contents(path, contents)
os.remove(path)
# Cleanup
finally:
if os.path.exists(dirname):
shutil.rmtree(dirname)