Skip to content

Commit

Permalink
treeTest.py: Get file_list from os.walk
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar-rishav committed Aug 6, 2016
1 parent 5206c9c commit 4edb1b6
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/treeTest.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import os
import unittest

from coalahtml.tree import Node, Tree
from coalib.coala_main import run_coala
from coalib.output.printers.ListLogPrinter import ListLogPrinter
from coalahtml.helper import parse_file_dict


class TreeTest(unittest.TestCase):

def setUp(self):
log_printer = ListLogPrinter()
file_dict = run_coala(log_printer=log_printer,
autoapply=False)[2]
self.FL = list(parse_file_dict(file_dict).keys())
self.FL = []
for root, _, file_list in os.walk(os.path.abspath('tests')):
self.FL.extend(os.path.join(root, fname) for fname in file_list)

def test_node(self):
node = Node(self.FL[0])
Expand All @@ -25,5 +22,5 @@ def test_extract(self):

def test_graph(self):
tr = Tree(self.FL)
testChild = tr.root.child['tests'].child.get('specs', None)
self.assertTrue(testChild)
testChild = tr.root.child.keys()
self.assertCountEqual(testChild, os.listdir('tests'))

0 comments on commit 4edb1b6

Please sign in to comment.