Passed
Push — master ( 500623...be817c )
by Xianshun
01:43
created

DepthFirstOrderUnitTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_topological_sort() 0 6 2
1
import unittest
2
3
from pyalgs.algorithms.graphs.topological_sort import DepthFirstOrder
4
from tests.algorithms.graphs.util import create_dag
5
6
7
class DepthFirstOrderUnitTest(unittest.TestCase):
8
9
    def test_topological_sort(self):
10
        G = create_dag()
11
12
        topological_sort = DepthFirstOrder(G)
13
14
        print(' => '.join([str(i) for i in topological_sort.postOrder()]))
15
16
17
if __name__ == '__main__':
18
    unittest.main()