本文整理匯總了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])
示例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])