本文整理汇总了Python中MyLibrary.LinkedLists.SinglyLinkedLists.SinglyLinkedList.SinglyLinkedList.isHeadNone方法的典型用法代码示例。如果您正苦于以下问题:Python SinglyLinkedList.isHeadNone方法的具体用法?Python SinglyLinkedList.isHeadNone怎么用?Python SinglyLinkedList.isHeadNone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyLibrary.LinkedLists.SinglyLinkedLists.SinglyLinkedList.SinglyLinkedList
的用法示例。
在下文中一共展示了SinglyLinkedList.isHeadNone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_delete_head_of_list_with_one_item
# 需要导入模块: from MyLibrary.LinkedLists.SinglyLinkedLists.SinglyLinkedList import SinglyLinkedList [as 别名]
# 或者: from MyLibrary.LinkedLists.SinglyLinkedLists.SinglyLinkedList.SinglyLinkedList import isHeadNone [as 别名]
def test_delete_head_of_list_with_one_item(self):
singlyLinkedListObject = SinglyLinkedList()
inputList = [1]
singlyLinkedListObject.populate(inputList)
singlyLinkedListObject.deleteHead()
self.assertTrue(singlyLinkedListObject.isHeadNone(), "Now that the only element in the list is deleted, Head of empty list must be None")
singlyLinkedListObject.deleteHead()
self.assertTrue(singlyLinkedListObject.isHeadNone(), "Now that the only element in the list is deleted, Head of empty list must be None")
示例2: test_delete_head_of_empty_list_more_than_once
# 需要导入模块: from MyLibrary.LinkedLists.SinglyLinkedLists.SinglyLinkedList import SinglyLinkedList [as 别名]
# 或者: from MyLibrary.LinkedLists.SinglyLinkedLists.SinglyLinkedList.SinglyLinkedList import isHeadNone [as 别名]
def test_delete_head_of_empty_list_more_than_once(self):
singlyLinkedListObject = SinglyLinkedList()
singlyLinkedListObject.deleteHead()
self.assertTrue(singlyLinkedListObject.isHeadNone(), "Head of empty list must be None")
singlyLinkedListObject.deleteHead()
self.assertTrue(singlyLinkedListObject.isHeadNone(), "Head of empty list must be None")
singlyLinkedListObject.deleteHead()
self.assertTrue(singlyLinkedListObject.isHeadNone(), "Head of empty list must be None")
示例3: test_delete_head_of_list_with_more_than_one_item
# 需要导入模块: from MyLibrary.LinkedLists.SinglyLinkedLists.SinglyLinkedList import SinglyLinkedList [as 别名]
# 或者: from MyLibrary.LinkedLists.SinglyLinkedLists.SinglyLinkedList.SinglyLinkedList import isHeadNone [as 别名]
def test_delete_head_of_list_with_more_than_one_item(self):
singlyLinkedListObject = SinglyLinkedList()
inputList = [1, 2, 3]
singlyLinkedListObject.populate(inputList)
singlyLinkedListObject.deleteHead()
self.assertFalse(singlyLinkedListObject.isHeadNone(), "Head of non-empty list must NOT be None")
self.assertFalse(singlyLinkedListObject.head == 2, "Expected hea data: %s, Actual head data: %s" %(2, singlyLinkedListObject.head))
singlyLinkedListObject.deleteHead()
self.assertFalse(singlyLinkedListObject.isHeadNone(), "Head of non-empty list must NOT be None")
self.assertFalse(singlyLinkedListObject.head == 3, "Expected hea data: %s, Actual head data: %s" %(3, singlyLinkedListObject.head))
singlyLinkedListObject.deleteHead()
self.assertTrue(singlyLinkedListObject.isHeadNone(), "Head of Empty list must be None")