Passed
Push — master ( 4a9099...6ecd56 )
by Xianshun
01:59
created

KruskalMSTUnitTest.test_mst()   A

Complexity

Conditions 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
1
import unittest
2
3
from pyalgs.algorithms.graphs.minimum_spanning_trees import KruskalMST
4
from tests.algorithms.graphs.util import create_edge_weighted_graph
5
6
7
class KruskalMSTUnitTest(unittest.TestCase):
8
    def test_mst(self):
9
        g = create_edge_weighted_graph()
10
        mst = KruskalMST(g)
11
12
        tree = mst.spanning_tree()
13
14
        for e in tree:
15
            print(e)