Skip to content

Commit

Permalink
Fix type annotation of test_0010_repository_with_tool_dependencies.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Oct 23, 2023
1 parent d09e867 commit 126df89
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import os

from ..base import common
from ..base.api import skip_if_api_v2
from ..base.twilltestcase import (
common,
ShedTwillTestCase,
)
from ..base.twilltestcase import ShedTwillTestCase

repository_name = "freebayes_0010"
repository_description = "Galaxy's freebayes tool"
Expand Down Expand Up @@ -45,6 +43,7 @@ def test_0010_create_freebayes_repository_and_upload_tool_xml(self):
"""
self.login(email=common.test_user_1_email, username=common.test_user_1_name)
category = self.populator.get_category_with_name("Test 0010 Repository With Tool Dependencies")
assert category
repository = self.get_or_create_repository(
name=repository_name,
description=repository_description,
Expand Down Expand Up @@ -73,6 +72,7 @@ def test_0015_upload_missing_tool_data_table_conf_file(self):
Uploading the tool_data_table_conf.xml.sample alone should not make the tool valid, but the error message should change.
"""
repository = self._get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
assert repository
strings_displayed = ["Upload a file named <b>sam_fa_indices.loc.sample"]
self.add_file_to_repository(
repository, "freebayes/tool_data_table_conf.xml.sample", strings_displayed=strings_displayed
Expand All @@ -91,6 +91,7 @@ def test_0020_upload_missing_sample_loc_file(self):
Uploading the tool_data_table_conf.xml.sample alone should not make the tool valid, but the error message should change.
"""
repository = self._get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
assert repository
self.add_file_to_repository(repository, "freebayes/sam_fa_indices.loc.sample")

def test_0025_upload_malformed_tool_dependency_xml(self):
Expand All @@ -100,6 +101,7 @@ def test_0025_upload_malformed_tool_dependency_xml(self):
Upload a tool_dependencies.xml file that contains <> in the text of the readme tag. This should show an error message about malformed xml.
"""
repository = self._get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
assert repository
target = os.path.join("freebayes", "malformed_tool_dependencies", "tool_dependencies.xml")
self.add_file_to_repository(
repository, target, strings_displayed=["Exception attempting to parse", "invalid element name"]
Expand All @@ -112,6 +114,7 @@ def test_0030_upload_invalid_tool_dependency_xml(self):
This should result in a message about the tool dependency configuration not matching the tool's requirements.
"""
repository = self._get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
assert repository
target = os.path.join("freebayes", "invalid_tool_dependencies", "tool_dependencies.xml")
strings_displayed = [
"The settings for <b>name</b>, <b>version</b> and <b>type</b> from a contained tool configuration"
Expand All @@ -125,6 +128,7 @@ def test_0035_upload_valid_tool_dependency_xml(self):
At this stage, there should be no errors on the upload page, as every missing or invalid file has been corrected.
"""
repository = self._get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
assert repository
target = os.path.join("freebayes", "tool_dependencies.xml")
self.add_file_to_repository(repository, target)

Expand All @@ -136,6 +140,7 @@ def test_0040_verify_tool_dependencies(self):
Verify that the manage repository page now displays the valid tool dependencies, and that there are no invalid tools shown on the manage page.
"""
repository = self._get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
assert repository
strings_displayed = ["freebayes", "0.9.4_9696d0ce8a9", "samtools", "0.1.18", "Valid tools", "package"]
strings_not_displayed = [self.invalid_tools_labels]
self.display_manage_repository_page(
Expand Down

0 comments on commit 126df89

Please sign in to comment.