当前位置: 首页>>代码示例>>Python>>正文


Python Dogstreams._get_dogstream_log_paths方法代码示例

本文整理汇总了Python中checks.datadog.Dogstreams._get_dogstream_log_paths方法的典型用法代码示例。如果您正苦于以下问题:Python Dogstreams._get_dogstream_log_paths方法的具体用法?Python Dogstreams._get_dogstream_log_paths怎么用?Python Dogstreams._get_dogstream_log_paths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在checks.datadog.Dogstreams的用法示例。


在下文中一共展示了Dogstreams._get_dogstream_log_paths方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_dogstream_log_path_globbing

# 需要导入模块: from checks.datadog import Dogstreams [as 别名]
# 或者: from checks.datadog.Dogstreams import _get_dogstream_log_paths [as 别名]
 def test_dogstream_log_path_globbing(self):
     """Make sure that globbed dogstream logfile matching works."""
     # Create a tmpfile to serve as a prefix for the other temporary
     # files we'll be globbing.
     first_tmpfile = NamedTemporaryFile()
     tmp_fprefix = os.path.basename(first_tmpfile.name)
     all_tmp_filenames = set([first_tmpfile.name])
     # We stick the file objects in here to avoid garbage collection (and
     # tmpfile deletion). Not sure why this was happening, but it's working
     # with this hack in.
     avoid_gc = []
     for i in range(3):
         new_tmpfile = NamedTemporaryFile(prefix=tmp_fprefix)
         all_tmp_filenames.add(new_tmpfile.name)
         avoid_gc.append(new_tmpfile)
     dogstream_glob = os.path.join(gettempdir(), tmp_fprefix + '*')
     paths = Dogstreams._get_dogstream_log_paths(dogstream_glob)
     self.assertEqual(set(paths), all_tmp_filenames)
开发者ID:DataDog,项目名称:dd-agent,代码行数:20,代码来源:test_datadog.py


注:本文中的checks.datadog.Dogstreams._get_dogstream_log_paths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。