class NodeTests(unittest.TestCase): def setUp(self): self.test = Node("test") self.test_neighbor = Node("test_neighbor") self.test.add_connection(self.test_neighbor, 100) # fungerar add_connection klaras test_get_connections def test_get_connections(self): self.assertIn(self.test_neighbor, self.test.get_connections()) def test_get_weight(self): self.assertTrue(self.test.get_weight(self.test_neighbor) == 100)
class NodeTests(unittest.TestCase): def setUp(self): self.test = Node("test") self.test_neighbor = Node("test_neighbor") self.test.add_connection(self.test_neighbor, 100) #fungerar add_connection klaras test_get_connections def test_get_connections(self): self.assertIn(self.test_neighbor, self.test.get_connections()) def test_get_weight(self): self.assertTrue(self.test.get_weight(self.test_neighbor) == 100)
def setUp(self): self.test = Node("test") self.test_neighbor = Node("test_neighbor") self.test.add_connection(self.test_neighbor, 100)