notes and test

This commit is contained in:
Costa Shulyupin 2020-07-22 19:43:51 +03:00
parent c2c75b0e0c
commit 4a2d75188e
1 changed files with 7 additions and 1 deletions

View File

@ -910,7 +910,8 @@ def write_dot(g, dot):
@open_file(0, mode='r') @open_file(0, mode='r')
def read_dot(dot): def read_dot(dot):
# read_dot pydot.graph_from_dot_data parse_dot_data from_pydot # faster custom version of eponymous function from external library
# pydot.graph_from_dot_data parse_dot_data from_pydot
dg = nx.DiGraph() dg = nx.DiGraph()
for a in dot: for a in dot:
a = a.strip() a = a.strip()
@ -1226,6 +1227,9 @@ def doxygen_xml(a):
def doxygen_length(a): def doxygen_length(a):
'''
calculates length of functions using doxygen xml
'''
g = my_graph() g = my_graph()
for x in list(glob.glob(os.path.join(a, "*.xml")) + [a]): for x in list(glob.glob(os.path.join(a, "*.xml")) + [a]):
if os.path.isfile(x): if os.path.isfile(x):
@ -1294,6 +1298,8 @@ class _unittest_autotest(unittest.TestCase):
self.assertRegex(popen( self.assertRegex(popen(
'srcxray.py "nx.DiGraph([{1,2},{2,3},{2,4}])"')[-1], 'srcxray.py "nx.DiGraph([{1,2},{2,3},{2,4}])"')[-1],
"\t\t4.*") "\t\t4.*")
os.system('srcxray.py doxygen init')
self.assertTrue(read_dot("doxygen.dot").number_of_edges() > 400)
def main(): def main():