本文整理汇总了Python中menu.Menu.back方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.back方法的具体用法?Python Menu.back怎么用?Python Menu.back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu.Menu
的用法示例。
在下文中一共展示了Menu.back方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_back_shouldGoToLastElementIfParentItemListWasShortended_withBackItem
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import back [as 别名]
def test_back_shouldGoToLastElementIfParentItemListWasShortended_withBackItem():
subFolders = [Folder("a", []), Folder("b", []), Folder("c", [])]
folder = Folder("", subFolders)
menu = Menu(folder)
menu.moveBy(-1).select()
subFolders.pop()
menu.back()
assert menu.item() is menu._backItem
示例2: test_back_multiLevel
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import back [as 别名]
def test_back_multiLevel():
menu = Menu(mainFolder)
menu.moveBy(1).select().moveBy(1).select()
menu.back()
assert menu.folder() is folder2
assert menu.item() is folder2b
menu.back()
assert menu.folder() is mainFolder
assert menu.item() is folder2
示例3: test_mainFolder_shouldReturnCurrentMainFolder
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import back [as 别名]
def test_mainFolder_shouldReturnCurrentMainFolder():
menu = Menu(mainFolder)
menu.select()
assert menu.folder() is folder1
assert menu.mainFolder() is folder1
menu.select()
assert menu.folder() is folder1a
assert menu.mainFolder() is folder1
menu.back().back()
assert menu.mainFolder() is None
示例4: test_back_doesNotNotifyListenersIfFolderNotChanged
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import back [as 别名]
def test_back_doesNotNotifyListenersIfFolderNotChanged():
countingListener = mocks.CountingMenuListener()
menu = Menu(mainFolder)
menu.addListener(countingListener)
menu.back()
assert len(countingListener.calls) == 0
示例5: test_back_shouldDoNothingForRootFolder
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import back [as 别名]
def test_back_shouldDoNothingForRootFolder():
menu = Menu(mainFolder)
menu.back().back()
assert menu.folder() is mainFolder
示例6: test_back_shouldRememberIndex
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import back [as 别名]
def test_back_shouldRememberIndex():
menu = Menu(mainFolder)
menu.moveBy(1)
menu.select()
menu.back()
assert menu.item() is folder2
示例7: test_back
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import back [as 别名]
def test_back():
menu = Menu(mainFolder)
menu.select()
menu.back()
assert menu.folder() is mainFolder