-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement graph orientation change (graphviz rankdir) (#289)
- Loading branch information
1 parent
d01169e
commit f21c24c
Showing
6 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python3 | ||
"""Test running go_plot subdag with different output orientation.""" | ||
|
||
from __future__ import print_function | ||
|
||
import os | ||
import subprocess | ||
|
||
|
||
def cmds_plot_annos(): | ||
"""Test running go_plot subdag with different output orientation.""" | ||
for idx, (cmd, check) in enumerate(_get_cmds()): | ||
print('------------------- TEST {I} ------------------------------------'.format(I=idx)) | ||
print(f'CMD: {cmd}') | ||
r = subprocess.run(cmd, shell=True, cwd='..') | ||
assert r.returncode == 0 | ||
|
||
with open('bbbb.dot') as f: | ||
ff = f.read() | ||
if check not in ff: | ||
raise AssertionError(f'Expected phrase "{check}" were not found in dot output.') | ||
os.remove('bbbb.dot') | ||
|
||
print("TEST PASSED") | ||
|
||
|
||
def _get_cmds(): | ||
"""Commands for generation of different styles, output md5sum""" | ||
# pylint: disable=line-too-long | ||
return [ | ||
('scripts/go_plot.py GO:0000010 -o tests/bbbb.dot --obo=tests/data/mini_obo.obo', 'rankdir=TB'), | ||
('scripts/go_plot.py GO:0000010 -o tests/bbbb.dot --obo=tests/data/mini_obo.obo --rankdir=TB', 'rankdir=TB'), | ||
('scripts/go_plot.py GO:0000010 -o tests/bbbb.dot --obo=tests/data/mini_obo.obo --rankdir=LR', 'rankdir=LR'), | ||
('scripts/go_plot.py GO:0000010 -o tests/bbbb.dot --obo=tests/data/mini_obo.obo --rankdir=BT', 'rankdir=BT'), | ||
('scripts/go_plot.py GO:0000010 -o tests/bbbb.dot --obo=tests/data/mini_obo.obo --rankdir=RL', 'rankdir=RL'), | ||
] | ||
|
||
|
||
if __name__ == '__main__': | ||
cmds_plot_annos() |