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


Python Collector.derive_folders方法代码示例

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


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

示例1: test_derive_file_elements_for_unknown_files

# 需要导入模块: from collector import Collector [as 别名]
# 或者: from collector.Collector import derive_folders [as 别名]
 def test_derive_file_elements_for_unknown_files(self):
     c = Collector()
     s = c.add_symbol("some_symbol", "00a")
     self.assertEqual("some_symbol", s[collector.NAME])
     self.assertNotIn(collector.PATH, s)
     self.assertNotIn(collector.BASE_FILE, s)
     c.derive_folders()
     self.assertEqual("<unknown>/<unknown>", s[collector.PATH])
     self.assertEqual("<unknown>", s[collector.BASE_FILE])
     self.assertIn(collector.FILE, s)
     file = s[collector.FILE]
     self.assertEqual("<unknown>", file[collector.NAME])
     folder = file[collector.FOLDER]
     self.assertEqual("<unknown>", file[collector.NAME])
开发者ID:kevincon,项目名称:puncover,代码行数:16,代码来源:collector_tests.py

示例2: test_derive_file_elements

# 需要导入模块: from collector import Collector [as 别名]
# 或者: from collector.Collector import derive_folders [as 别名]
    def test_derive_file_elements(self):
        c = Collector()
        s1 = {collector.PATH: "/Users/behrens/Documents/projects/pebble/puncover/pebble/build/../src/puncover.c"}
        s2 = {collector.PATH: "/Users/thomas/work/arm-eabi-toolchain/build/gcc-final/arm-none-eabi/thumb2/libgcc/../../../../../gcc-4.7-2012.09/libgcc/config/arm/ieee754-df.S"}
        s3 = {collector.PATH: "src/puncover.c"}
        c.symbols = {
            1: s1,
            2: s2,
            3: s3,
        }

        c.derive_folders()
        self.assertEqual("/Users/behrens/Documents/projects/pebble/puncover/pebble/src/puncover.c", s1[collector.PATH])
        self.assertIsNotNone(s1[collector.FILE])

        self.assertEqual("/Users/thomas/work/arm-eabi-toolchain/gcc-4.7-2012.09/libgcc/config/arm/ieee754-df.S", s2[collector.PATH])
        self.assertIsNotNone(s2[collector.FILE])

        self.assertEqual("src/puncover.c", s3[collector.PATH])
        self.assertIsNotNone(s3[collector.FILE])
开发者ID:kevincon,项目名称:puncover,代码行数:22,代码来源:collector_tests.py


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