-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add -dgdpi for workflow diagram and --version and fix logger
- Loading branch information
1 parent
570c0eb
commit b96264c
Showing
9 changed files
with
173 additions
and
44 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# data | ||
.eggs | ||
.idea | ||
*.log | ||
*.png | ||
*.pyc | ||
*.swp | ||
*py~ | ||
|
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
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,38 @@ | ||
[loggers] | ||
keys=root,luigi,luigi_interface | ||
|
||
[handlers] | ||
keys=consoleHandler,fileHandler | ||
|
||
[formatters] | ||
keys=PrettyFormatter | ||
|
||
[logger_root] | ||
level=INFO | ||
handlers=consoleHandler,fileHandler | ||
|
||
[logger_luigi] | ||
level=INFO | ||
handlers=consoleHandler,fileHandler | ||
qualname=luigi | ||
propagate=0 | ||
|
||
[logger_luigi_interface] | ||
level=INFO | ||
handlers=consoleHandler,fileHandler | ||
qualname=luigi-interface | ||
propagate=0 | ||
|
||
[handler_consoleHandler] | ||
class=StreamHandler | ||
formatter=PrettyFormatter | ||
args=(sys.stdout,) | ||
|
||
[handler_fileHandler] | ||
class=FileHandler | ||
formatter=PrettyFormatter | ||
args=('logs.log',) | ||
|
||
[formatter_PrettyFormatter] | ||
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s | ||
datefmt=%Y-%m-%d %H:%M:%S |
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,47 @@ | ||
"""Tests for the synthesis_workflow.cli module.""" | ||
import re | ||
|
||
from synthesis_workflow.tasks import cli | ||
|
||
|
||
class TestCLI: | ||
"""Test the CLI of the synthesis-workflow package.""" | ||
|
||
def test_help(self, capsys): | ||
"""Test the --help argument.""" | ||
try: | ||
cli.main(arguments=["--help"]) | ||
except SystemExit: | ||
pass | ||
captured = capsys.readouterr() | ||
assert ( | ||
re.match( | ||
r"usage: \S+ .*Run the workflow\n\npositional arguments:\s*" | ||
r"{ValidateSynthesis,ValidateVacuumSynthesis,ValidateRescaling}\s*" | ||
r"Possible workflows.*", | ||
captured.out, | ||
flags=re.DOTALL, | ||
) | ||
is not None | ||
) | ||
|
||
def test_dependency_graph(self, vacuum_working_directory): | ||
"""Test the --create-dependency-graph argument.""" | ||
root_dir = vacuum_working_directory[0].parent | ||
cli.main( | ||
arguments=[ | ||
"--create-dependency-graph", | ||
str(root_dir / "dependency_graph.png"), | ||
"ValidateVacuumSynthesis", | ||
] | ||
) | ||
|
||
assert (root_dir / "dependency_graph.png").exists() | ||
|
||
|
||
def test_entry_point(script_runner): | ||
"""Test the entry point.""" | ||
ret = script_runner.run("synthesis-workflow", "--version") | ||
assert ret.success | ||
assert ret.stdout.startswith("synthesis-workflow, version ") | ||
assert ret.stderr == "" |