本文整理匯總了Python中bzrlib.weave.Weave._names方法的典型用法代碼示例。如果您正苦於以下問題:Python Weave._names方法的具體用法?Python Weave._names怎麽用?Python Weave._names使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bzrlib.weave.Weave
的用法示例。
在下文中一共展示了Weave._names方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: runTest
# 需要導入模塊: from bzrlib.weave import Weave [as 別名]
# 或者: from bzrlib.weave.Weave import _names [as 別名]
def runTest(self):
# FIXME make the weave, dont poke at it.
k = Weave()
k._names = ['0', '1', '2']
k._name_map = {'0':0, '1':1, '2':2}
k._parents = [frozenset(),
frozenset([0]),
frozenset([0]),
]
k._weave = [('{', 0),
"first line",
('}', 0),
('{', 1),
"second line",
('}', 1),
('{', 2),
"alternative second line",
('}', 2),
]
k._sha1s = [sha_string('first line')
, sha_string('first linesecond line')
, sha_string('first linealternative second line')]
self.assertEqual(k.get_lines(0),
["first line"])
self.assertEqual(k.get_lines(1),
["first line",
"second line"])
self.assertEqual(k.get_lines('2'),
["first line",
"alternative second line"])
self.assertEqual(list(k.get_ancestry(['2'])),
['0', '2'])