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

KruskalMSTUnitTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_mst() 0 8 2
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)