本文整理汇总了Python中Vintageous.vi.mappings.Mappings.expand_first方法的典型用法代码示例。如果您正苦于以下问题:Python Mappings.expand_first方法的具体用法?Python Mappings.expand_first怎么用?Python Mappings.expand_first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vintageous.vi.mappings.Mappings
的用法示例。
在下文中一共展示了Mappings.expand_first方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Test_Mapping_Expanding
# 需要导入模块: from Vintageous.vi.mappings import Mappings [as 别名]
# 或者: from Vintageous.vi.mappings.Mappings import expand_first [as 别名]
class Test_Mapping_Expanding(BufferTest):
def setUp(self):
super().setUp()
self.state = state.State(self.view)
self.mappings = Mappings(self.state)
self.mappings.clear()
def testCanExpand(self):
for (i, data) in enumerate(expanding_tests):
setup_data, test_data = data
mode, keys, new_mapping = setup_data
self.mappings.add(mode, keys, new_mapping)
self.state.mode = modes.NORMAL
seq, expected_head, expected_mapping, expected_tail, expected_full, expected_status = test_data
result = self.mappings.expand_first(seq)
self.assertEqual(result.head, expected_head, '[{0}] head failed'.format(i))
self.assertEqual(result.tail, expected_tail, '[{0}] tail failed'.format(i))
self.assertEqual(result.mapping, expected_mapping, '[{0}] mapping failed'.format(i))
self.assertEqual(result.sequence, expected_full, '[{0}] sequence failed'.format(i))
self.assertEqual(result.status, expected_status, '[{0}] status failed'.format(i))
self.mappings.clear()