-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix galaxy testing for xunit reports in newer nose versions.
Fixes planemo for galaxyproject/galaxy#172.
- Loading branch information
Showing
5 changed files
with
96 additions
and
20 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
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><testsuite name="nosetests" tests="1" errors="0" failures="0" skip="0"><testcase classname="functional.test_toolbox.TestForTool_cat" name="functional.test_toolbox.TestForTool_cat.test_tool_000000" time="13" /></testsuite> |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><testsuite name="nosetests" tests="3" errors="0" failures="0" skip="0"><testcase classname="functional.test_toolbox.TestForTool_cat" name="test_tool_000000" time="12.190"></testcase></testsuite> |
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,29 @@ | ||
""" Tests for the galaxy_test module :) """ | ||
|
||
import os | ||
|
||
from .test_utils import TEST_DATA_DIR | ||
|
||
from planemo import galaxy_test | ||
|
||
nose_1_3_report = os.path.join(TEST_DATA_DIR, "xunit_nose_1_3.xml") | ||
nose_0_11_report = os.path.join(TEST_DATA_DIR, "xunit_nose_0_11.xml") | ||
|
||
|
||
def get_test_id_new(): | ||
_get_test_id(nose_1_3_report) | ||
|
||
|
||
def get_test_id_old(): | ||
_get_test_id(nose_0_11_report) | ||
|
||
|
||
def _get_test_id(path): | ||
xml_tree = galaxy_test.parse_xunit_report(path) | ||
root = xml_tree.getroot() | ||
first_testcase = galaxy_test.find_testcases(root)[0] | ||
test_id = galaxy_test.test_id(first_testcase) | ||
assert test_id.label == "cat[0]" | ||
expected_id = "functional.test_toolbox.TestForTool_cat.test_tool_000000" | ||
assert test_id.id == expected_id | ||
assert test_id.num == 0 |