def test_CheckSizeLinkAfterAddingLinkNodeRepeating(self): expectedSize = 1 node0 = Node({0, 1, 2}) addingNode = Node({3, 4}) node0.addLinkNode(addingNode) node0.addLinkNode(addingNode) self.assertEqual(expectedSize, node0.linkSize)
def test_CheckSizeLinkAfterAddingLinkNode(self): expectedSize = 2 node0 = Node({0, 1, 2}) addingNode1 = Node({3, 4}) addingNode2 = Node({5, 6}) node0.addLinkNode(addingNode1) node0.addLinkNode(addingNode2) self.assertEqual(expectedSize, node0.linkSize)
def test_GetLink(self): node0 = Node({0, 1, 2}) addingNode1 = Node({3, 4}) addingNode2 = Node({5, 6}) newSet = set() node0.addLinkNode(addingNode1) node0.addLinkNode(addingNode2) newSet.add(addingNode1) newSet.add(addingNode2) self.assertSetEqual(newSet, node0.getLink())
def test_CheckAddingLinkNodeWithError(self): node0 = Node({0, 1, 2}) node0.addLinkNode("NotNode") self.assertRaises(TypeError, node0.link)
def test_CheckAddingLinkNode(self): node0 = Node({0, 1, 2}) addingNode = Node({3, 4}) node0.addLinkNode(addingNode) self.assertEqual({Node({3, 4})}, node0.link)