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

DepthFirstOrderUnitTest.test_topological_sort()   A

Complexity

Conditions 2

Size

Total Lines 6

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 6
rs 9.4285
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()