commit/galaxy-central: jmchilton: Bugfix for 44dfa6f and typos in unit tests that caused it to go undetected.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/bfd679408c84/ Changeset: bfd679408c84 User: jmchilton Date: 2014-12-29 04:25:56+00:00 Summary: Bugfix for 44dfa6f and typos in unit tests that caused it to go undetected. Affected #: 3 files diff -r 1912dec92b728b974094456be8eb6d84d34a7ca6 -r bfd679408c84a4c6f1d2b1a09eec1dab9c2d212b lib/tool_shed/galaxy_install/tools/tool_panel_manager.py --- a/lib/tool_shed/galaxy_install/tools/tool_panel_manager.py +++ b/lib/tool_shed/galaxy_install/tools/tool_panel_manager.py @@ -475,8 +475,10 @@ else: del has_elems[ tool_key ] if uninstall: - if tool_key in toolbox.integrated_tool_panel: - del toolbox.integrated_tool_panel[ tool_key ] + if hasattr( integrated_has_elems, "elems" ): + integrated_has_elems = integrated_has_elems.elems + if tool_key in integrated_has_elems: + del integrated_has_elems[ tool_key ] # Remove the tools from the toolbox's tools_by_id dictionary. for guid_to_remove in guids_to_remove: diff -r 1912dec92b728b974094456be8eb6d84d34a7ca6 -r bfd679408c84a4c6f1d2b1a09eec1dab9c2d212b test/unit/tool_shed_unit_tests/test_tool_panel_manager.py --- a/test/unit/tool_shed_unit_tests/test_tool_panel_manager.py +++ b/test/unit/tool_shed_unit_tests/test_tool_panel_manager.py @@ -67,10 +67,10 @@ self._setup_two_versions_remove_one( section=True, uninstall=False ) self._verify_version_2_removed_from_panel( ) # Still in tool conf since not uninstalled only deactivated... - assert "github.com/galaxyproect/example/test_tool/0.2" in open(os.path.join(self.test_directory, "tool_conf.xml"), "r").read() + assert "github.com/galaxyproject/example/test_tool/0.2" in open(os.path.join(self.test_directory, "tool_conf.xml"), "r").read() self._verify_tool_confs() - self._remove_guids( ["github.com/galaxyproect/example/test_tool/0.1"], uninstall=False ) + self._remove_guids( ["github.com/galaxyproject/example/test_tool/0.1"], uninstall=False ) # Now no versions of this tool are returned by toolbox. all_versions = self.toolbox.get_tool( "test_tool", get_all_versions=True ) @@ -84,24 +84,25 @@ self._setup_two_versions_remove_one( section=True, uninstall=True ) self._verify_version_2_removed_from_panel( ) # Not in tool conf because it was uninstalled. - assert "github.com/galaxyproect/example/test_tool/0.2" not in open(os.path.join(self.test_directory, "tool_conf.xml"), "r").read() + assert "github.com/galaxyproject/example/test_tool/0.2" not in open(os.path.join(self.test_directory, "tool_conf.xml"), "r").read() + assert "tool_github.com/galaxyproject/example/test_tool/0.2" not in self.toolbox.integrated_tool_panel["tid"].elems self._verify_tool_confs() def test_deactivate_outside_section( self ): self._setup_two_versions_remove_one( section=False, uninstall=False ) self._verify_version_2_removed_from_panel( section=False ) # Still in tool conf since not uninstalled only deactivated... - assert "github.com/galaxyproect/example/test_tool/0.2" in open(os.path.join(self.test_directory, "tool_conf.xml"), "r").read() + assert "github.com/galaxyproject/example/test_tool/0.2" in open(os.path.join(self.test_directory, "tool_conf.xml"), "r").read() self._verify_tool_confs() def test_uninstall_outside_section( self ): self._setup_two_versions_remove_one( section=False, uninstall=True ) self._verify_version_2_removed_from_panel( section=False ) # Still in tool conf since not uninstalled only deactivated... - assert "github.com/galaxyproect/example/test_tool/0.2" not in open(os.path.join(self.test_directory, "tool_conf.xml"), "r").read() + assert "github.com/galaxyproject/example/test_tool/0.2" not in open(os.path.join(self.test_directory, "tool_conf.xml"), "r").read() self._verify_tool_confs() - self._remove_guids( ["github.com/galaxyproect/example/test_tool/0.1"], uninstall=True ) + self._remove_guids( ["github.com/galaxyproject/example/test_tool/0.1"], uninstall=True ) # Now no versions of this tool are returned by toolbox. all_versions = self.toolbox.get_tool( "test_tool", get_all_versions=True ) @@ -116,7 +117,7 @@ self._setup_two_versions_in_config( section=True ) self._setup_two_versions() self.toolbox - self._remove_guids( ["github.com/galaxyproect/example/test_tool/0.2"], uninstall=uninstall ) + self._remove_guids( ["github.com/galaxyproject/example/test_tool/0.2"], uninstall=uninstall ) def _verify_version_2_removed_from_panel( self, section=True ): # Check that test_tool now only has one version... @@ -127,12 +128,12 @@ if section: section = self.toolbox.tool_panel["tid"] assert len(section.elems) == 1 - assert section.elems.values()[0].id == "github.com/galaxyproect/example/test_tool/0.1" + assert section.elems.values()[0].id == "github.com/galaxyproject/example/test_tool/0.1" - assert "github.com/galaxyproect/example/test_tool/0.2" not in self.toolbox.integrated_tool_panel["tid"].elems + assert "github.com/galaxyproject/example/test_tool/0.2" not in self.toolbox.integrated_tool_panel["tid"].elems else: - self.toolbox.tool_panel.values()[0].id == "github.com/galaxyproect/example/test_tool/0.1" - assert "github.com/galaxyproect/example/test_tool/0.2" not in self.toolbox.integrated_tool_panel + self.toolbox.tool_panel.values()[0].id == "github.com/galaxyproject/example/test_tool/0.1" + assert "github.com/galaxyproject/example/test_tool/0.2" not in self.toolbox.integrated_tool_panel def _remove_guids( self, guids, uninstall, shed_tool_conf="tool_conf.xml" ): self.tpm.remove_guids( diff -r 1912dec92b728b974094456be8eb6d84d34a7ca6 -r bfd679408c84a4c6f1d2b1a09eec1dab9c2d212b test/unit/tools/test_toolbox.py --- a/test/unit/tools/test_toolbox.py +++ b/test/unit/tools/test_toolbox.py @@ -10,12 +10,12 @@ CONFIG_TEST_TOOL_VERSION_TEMPLATE = string.Template( - """ <tool file="tool.xml" guid="github.com/galaxyproect/example/test_tool/0.${version}"> + """ <tool file="tool.xml" guid="github.com/galaxyproject/example/test_tool/0.${version}"><tool_shed>github.com</tool_shed><repository_name>example</repository_name><repository_owner>galaxyproject</repository_owner><installed_changeset_revision>${version}</installed_changeset_revision> - <id>github.com/galaxyproect/example/test_tool/0.${version}</id> + <id>github.com/galaxyproject/example/test_tool/0.${version}</id><version>0.${version}</version></tool> """ @@ -72,14 +72,14 @@ def _setup_two_versions( self ): repository1 = self._repo_install( changeset="1" ) version1 = tool_shed_install.ToolVersion() - version1.tool_id = "github.com/galaxyproect/example/test_tool/0.1" + version1.tool_id = "github.com/galaxyproject/example/test_tool/0.1" version1.repository = repository1 self.app.install_model.context.add( version1 ) self.app.install_model.context.flush( ) repository2 = self._repo_install( changeset="2" ) version2 = tool_shed_install.ToolVersion() - version2.tool_id = "github.com/galaxyproect/example/test_tool/0.2" + version2.tool_id = "github.com/galaxyproject/example/test_tool/0.2" version2.repository = repository2 self.app.install_model.context.add( version2 ) @@ -184,7 +184,7 @@ # Assert only newer version of the tool loaded into the panel. section = self.toolbox.tool_panel["tid"] assert len(section.elems) == 1 - assert section.elems.values()[0].id == "github.com/galaxyproect/example/test_tool/0.2" + assert section.elems.values()[0].id == "github.com/galaxyproject/example/test_tool/0.2" def test_group_tools_out_of_section( self ): self._init_tool() @@ -212,10 +212,10 @@ self._init_tool() self._setup_two_versions_in_config( ) self._setup_two_versions() - assert self.toolbox.get_tool_id( "test_tool" ) == "github.com/galaxyproect/example/test_tool/0.1" - assert self.toolbox.get_tool_id( "github.com/galaxyproect/example/test_tool/0.1" ) == "github.com/galaxyproect/example/test_tool/0.1" - assert self.toolbox.get_tool_id( "github.com/galaxyproect/example/test_tool/0.2" ) == "github.com/galaxyproect/example/test_tool/0.2" - assert self.toolbox.get_tool_id( "github.com/galaxyproect/example/test_tool/0.3" ) is None + assert self.toolbox.get_tool_id( "test_tool" ) == "github.com/galaxyproject/example/test_tool/0.1" + assert self.toolbox.get_tool_id( "github.com/galaxyproject/example/test_tool/0.1" ) == "github.com/galaxyproject/example/test_tool/0.1" + assert self.toolbox.get_tool_id( "github.com/galaxyproject/example/test_tool/0.2" ) == "github.com/galaxyproject/example/test_tool/0.2" + assert self.toolbox.get_tool_id( "github.com/galaxyproject/example/test_tool/0.3" ) is None def test_tool_dir( self ): self._init_tool() @@ -285,14 +285,14 @@ # Verify lineage_ids on both tools is correctly ordered. for version in ["0.1", "0.2"]: - guid = "github.com/galaxyproect/example/test_tool/" + version + guid = "github.com/galaxyproject/example/test_tool/" + version lineage_ids = self.toolbox.get_tool( guid ).lineage_ids - assert lineage_ids[ 0 ] == "github.com/galaxyproect/example/test_tool/0.1" - assert lineage_ids[ 1 ] == "github.com/galaxyproect/example/test_tool/0.2" + assert lineage_ids[ 0 ] == "github.com/galaxyproject/example/test_tool/0.1" + assert lineage_ids[ 1 ] == "github.com/galaxyproject/example/test_tool/0.2" # Test tool_version attribute. - assert self.toolbox.get_tool( "test_tool", tool_version="0.1" ).guid == "github.com/galaxyproect/example/test_tool/0.1" - assert self.toolbox.get_tool( "test_tool", tool_version="0.2" ).guid == "github.com/galaxyproect/example/test_tool/0.2" + assert self.toolbox.get_tool( "test_tool", tool_version="0.1" ).guid == "github.com/galaxyproject/example/test_tool/0.1" + assert self.toolbox.get_tool( "test_tool", tool_version="0.2" ).guid == "github.com/galaxyproject/example/test_tool/0.2" def __remove_itp( self ): os.remove( os.path) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org