本文整理汇总了Python中pulp.plugins.util.metadata_writer.MetadataFileContext.metadata_file_handle方法的典型用法代码示例。如果您正苦于以下问题:Python MetadataFileContext.metadata_file_handle方法的具体用法?Python MetadataFileContext.metadata_file_handle怎么用?Python MetadataFileContext.metadata_file_handle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.plugins.util.metadata_writer.MetadataFileContext
的用法示例。
在下文中一共展示了MetadataFileContext.metadata_file_handle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_finalize_closed_gzip_file
# 需要导入模块: from pulp.plugins.util.metadata_writer import MetadataFileContext [as 别名]
# 或者: from pulp.plugins.util.metadata_writer.MetadataFileContext import metadata_file_handle [as 别名]
def test_finalize_closed_gzip_file(self):
# this test makes sure that we can properly detect the closed state of
# a gzip file, because on python 2.6 we have to take special measures
# to do so.
path = os.path.join(os.path.dirname(__file__), '../../../data/foo.tar.gz')
context = MetadataFileContext('/a/b/c')
context.metadata_file_handle = gzip.open(path)
context.metadata_file_handle.close()
# just make sure this doesn't complain.
context.finalize()