File: ksRunModulesTest.py

package info (click to toggle)
kissplice 2.6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,752 kB
  • sloc: cpp: 8,783; python: 1,618; perl: 389; sh: 72; makefile: 18
file content (28 lines) | stat: -rwxr-xr-x 930 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python3
import re
import fnmatch
import os
from sys import argv
from os.path import dirname, abspath
import ProcessLauncher
TEST_INSTDIR=dirname(abspath(argv[0])) 

command_line= argv[1]+"/ks_run_modules "+TEST_INSTDIR+"/data/graph_HBM75brainliver_100000_k25.edges "+TEST_INSTDIR+"/data/graph_HBM75brainliver_100000_k25.nodes 25 "+TEST_INSTDIR+"/data/test_ks_run_modules_output_graph"

result = ProcessLauncher.run(command_line)
print(result)

# testing expected results
successful = True
if not (re.search('Number of biconnected components found: 109', result.decode())):
    successful = False
    
#removing the output files
for root,dirs,files in os.walk(TEST_INSTDIR+"/data"):
    for filename in fnmatch.filter(files,'test_ks_run_modules_output*'):
        os.remove(os.path.join(root,filename))
# summary
if successful:
    print("ks_run_modules: test SUCCESSFUL")
else:
    print("ks_run_modules: test FAILED")