def test_lint_ga_unicycler_training(): # no tags, fails linting assert main(["lint", "--training-topic", "assembly", os.path.join(TEST_PATH, "unicycler.ga")]) == 1 # correct tag passes linting assert main(["lint", "--training-topic", "assembly", os.path.join(TEST_PATH, "unicycler-hacked-tags.ga")]) == 0 # incorrect tag, fails linting assert main(["lint", "--training-topic", "mapping", os.path.join(TEST_PATH, "unicycler-hacked-tags.ga")]) == 1
def test_lint_examples(): for file_name in os.listdir(TEST_LINT_EXAMPLES): file_path = os.path.join(TEST_LINT_EXAMPLES, file_name) expected_exit_code = int(file_name[0]) actual_exit_code = main(["lint", file_path]) if actual_exit_code != expected_exit_code: contents = open(file_path, "r").read() template = "File [%s] didn't lint properly - expected exit code [%d], got [%d]. Contents:\n%s" raise AssertionError(template % (file_name, expected_exit_code, actual_exit_code, contents))
def test_lint_ecoli_comparison(): assert main(["lint", os.path.join(TEST_PATH, "ecoli-comparison.ga")]) == 1 # no outputs
def test_lint_ga_unicycler_ts_tools(): # only difference is testoolshed tool. assert main(["lint", os.path.join(TEST_PATH, "unicycler-hacked-testtoolshed.ga")]) == 1
def test_lint_ga_unicycler_missing_tools(): # only difference is one missing tool. assert main(["lint", os.path.join(TEST_PATH, "unicycler-hacked-no-tool.ga")]) == 1
def test_lint_ga_unicycler(): assert main(["lint", os.path.join(TEST_PATH, "unicycler.ga")]) == 0
def test_lint_ga_basic(): assert main(["lint", os.path.join(TEST_PATH, "wf3-shed-tools-raw.ga")]) == 1 # no outputs