def testSetAndGetWeight(self): """ Testing set&gets methods of NodeData's weight """ node1 = NodeData() node1.setWeight(8) self.assertEqual(8, node1.getWeight())
def test_get_edge_weight(self): pos = (1, 2, 3) node = NodeData(1, pos, 3.4) node.add_dest(1, 3.2) node.add_dest(2, 3.2) node.add_dest(3, 4.5) node.add_dest(4, 1.3) node.add_dest(5, 3.4) node.add_dest(6, 2.3) test_dict = {'1': None, '2': 3.2, '3': 4.5, '4': 1.3, '5': 3.4, '6': 2.3} for k, v in test_dict.items(): self.assertEqual(node.getWeight(int(k)), v)
def testSetAndGetWeight(self): node1 = NodeData() node1.setWeight(8) self.assertEqual(8, node1.getWeight())