本文整理汇总了Python中awscli.customizations.s3.filegenerator.FileGenerator.should_ignore_file方法的典型用法代码示例。如果您正苦于以下问题:Python FileGenerator.should_ignore_file方法的具体用法?Python FileGenerator.should_ignore_file怎么用?Python FileGenerator.should_ignore_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类awscli.customizations.s3.filegenerator.FileGenerator
的用法示例。
在下文中一共展示了FileGenerator.should_ignore_file方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_no_skip_symlink_dir
# 需要导入模块: from awscli.customizations.s3.filegenerator import FileGenerator [as 别名]
# 或者: from awscli.customizations.s3.filegenerator.FileGenerator import should_ignore_file [as 别名]
def test_no_skip_symlink_dir(self):
filename = 'dir'
path = os.path.join(self.files.rootdir, 'dir/')
os.mkdir(path)
sym_path = os.path.join(self.files.rootdir, 'symlink')
os.symlink(path, sym_path)
filegenerator = FileGenerator(self.client, '', True)
self.assertFalse(filegenerator.should_ignore_file(sym_path))
self.assertFalse(filegenerator.should_ignore_file(path))
示例2: test_no_skip_symlink
# 需要导入模块: from awscli.customizations.s3.filegenerator import FileGenerator [as 别名]
# 或者: from awscli.customizations.s3.filegenerator.FileGenerator import should_ignore_file [as 别名]
def test_no_skip_symlink(self):
filename = 'foo.txt'
path = self.files.create_file(os.path.join(self.files.rootdir,
filename),
contents='foo.txt contents')
sym_path = os.path.join(self.files.rootdir, 'symlink')
os.symlink(path, sym_path)
filegenerator = FileGenerator(self.client, '', True)
self.assertFalse(filegenerator.should_ignore_file(sym_path))
self.assertFalse(filegenerator.should_ignore_file(path))
示例3: test_skip_symlink
# 需要导入模块: from awscli.customizations.s3.filegenerator import FileGenerator [as 别名]
# 或者: from awscli.customizations.s3.filegenerator.FileGenerator import should_ignore_file [as 别名]
def test_skip_symlink(self):
filename = 'foo.txt'
self.files.create_file(os.path.join(self.files.rootdir,
filename),
contents='foo.txt contents')
sym_path = os.path.join(self.files.rootdir, 'symlink')
os.symlink(filename, sym_path)
filegenerator = FileGenerator(self.service, self.endpoint,
'', False)
self.assertTrue(filegenerator.should_ignore_file(sym_path))
示例4: test_warning
# 需要导入模块: from awscli.customizations.s3.filegenerator import FileGenerator [as 别名]
# 或者: from awscli.customizations.s3.filegenerator.FileGenerator import should_ignore_file [as 别名]
def test_warning(self):
path = os.path.join(self.files.rootdir, 'badsymlink')
os.symlink('non-existent-file', path)
filegenerator = FileGenerator(self.service, self.endpoint,
'', True)
self.assertTrue(filegenerator.should_ignore_file(path))