當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。