Skip to content

Commit

Permalink
Fix .metadata_ in tool_shed dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Oct 21, 2021
1 parent bd765b0 commit a44d779
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/tool_shed/galaxy_install/dependency_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def populate_containers_dict_from_repository_metadata(self, tool_shed_url, tool_
when displaying repository dependencies for installed repositories and when displaying
them for uninstalled repositories that are being reinstalled.
"""
metadata = repository.metadata
metadata = repository.metadata_
if metadata:
# Handle proprietary datatypes.
datatypes = metadata.get('datatypes', None)
Expand All @@ -464,7 +464,7 @@ def populate_containers_dict_from_repository_metadata(self, tool_shed_url, tool_
readme_files_dict = readme_util.build_readme_files_dict(self.app,
repository,
repository.changeset_revision,
repository.metadata, tool_path)
repository.metadata_, tool_path)
else:
readme_files_dict = None
# Handle repository dependencies.
Expand Down
14 changes: 7 additions & 7 deletions lib/tool_shed/test/base/twilltestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def check_galaxy_repository_db_status(self, repository_name, owner, expected_sta
(installed_repository.status, expected_status)

def check_galaxy_repository_tool_panel_section(self, repository, expected_tool_panel_section):
metadata = repository.metadata
metadata = repository.metadata_
assert 'tools' in metadata, f'Tools not found in repository metadata: {metadata}'
# If integrated_tool_panel.xml is to be tested, this test method will need to be enhanced to handle tools
# from the same repository in different tool panel sections. Getting the first tool guid is ok, because
Expand Down Expand Up @@ -571,7 +571,7 @@ def display_galaxy_browse_repositories_page(self, strings_displayed=None, string
self.check_for_strings(strings_displayed, strings_not_displayed)

def display_installed_jobs_list_page(self, installed_repository, data_manager_names=None, strings_displayed=None, strings_not_displayed=None):
data_managers = installed_repository.metadata.get('data_manager', {}).get('data_managers', {})
data_managers = installed_repository.metadata_.get('data_manager', {}).get('data_managers', {})
if data_manager_names:
if not isinstance(data_manager_names, list):
data_manager_names = [data_manager_names]
Expand Down Expand Up @@ -1500,14 +1500,14 @@ def verify_installed_repositories(self, installed_repositories=None, uninstalled

def verify_installed_repository_metadata_unchanged(self, name, owner):
installed_repository = test_db_util.get_installed_repository_by_name_owner(name, owner)
metadata = installed_repository.metadata
self.reset_installed_repository_metadata(installed_repository)
new_metadata = installed_repository.metadata
metadata = installed_repository.metadata_
self.reset_installed_repository_metadata_(installed_repository)
new_metadata = installed_repository.metadata_
assert metadata == new_metadata, f'Metadata for installed repository {name} differs after metadata reset.'

def verify_installed_repository_no_tool_panel_section(self, repository):
'''Verify that there is no 'tool_panel_section' entry in the repository metadata.'''
metadata = repository.metadata
metadata = repository.metadata_
assert 'tool_panel_section' not in metadata, f'Tool panel section incorrectly found in metadata: {metadata}'

def verify_installed_repository_data_table_entries(self, required_data_table_entries):
Expand Down Expand Up @@ -1582,7 +1582,7 @@ def verify_tool_metadata_for_installed_repository(self, installed_repository, st
if strings_not_displayed is None:
strings_not_displayed = []
repository_id = self.security.encode_id(installed_repository.id)
for tool in installed_repository.metadata['tools']:
for tool in installed_repository.metadata_['tools']:
strings = list(strings_displayed)
strings.extend([tool['id'], tool['description'], tool['version'], tool['guid'], tool['name']])
params = dict(repository_id=repository_id, tool_id=tool['id'])
Expand Down
2 changes: 1 addition & 1 deletion lib/tool_shed/test/functional/test_1070_invalid_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ def test_0015_install_freebayes_repository(self):
strings_not_displayed=['bisulfite mapper'])
self.verify_tool_metadata_for_installed_repository(installed_repository)
self.update_installed_repository(installed_repository, strings_displayed=["there are no updates available"])
assert 'invalid_tools' in installed_repository.metadata, 'No invalid tools were defined in %s.' % \
assert 'invalid_tools' in installed_repository.metadata_, 'No invalid tools were defined in %s.' % \
installed_repository.name
8 changes: 4 additions & 4 deletions lib/tool_shed/test/functional/test_1300_reset_all_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def test_9905_reset_metadata_on_all_repositories(self):
repository_metadata = dict()
repositories = self.test_db_util.get_all_installed_repositories(actually_installed=True)
for repository in repositories:
repository_metadata[self.security.encode_id(repository.id)] = repository.metadata
repository_metadata[self.security.encode_id(repository.id)] = repository.metadata_
self.reset_metadata_on_selected_installed_repositories(list(repository_metadata.keys()))
for repository in repositories:
self.test_db_util.ga_refresh(repository)
Expand All @@ -452,7 +452,7 @@ def test_9905_reset_metadata_on_all_repositories(self):
# is normal and expected behavior, the functional tests assume that repository metadata will not change
# in any way after a reset. A workaround is to remove the tool panel section from the stored repository
# metadata dict, in order to eliminate the misleading detection of changed metadata.
if 'tool_panel_section' in old_metadata and 'tool_panel_section' not in repository.metadata:
if 'tool_panel_section' in old_metadata and 'tool_panel_section' not in repository.metadata_:
del old_metadata['tool_panel_section']
assert repository.metadata == old_metadata, 'Metadata for %s repository %s changed after reset. \nOld: %s\nNew: %s' % \
(repository.status, repository.name, old_metadata, repository.metadata)
assert repository.metadata_ == old_metadata, 'Metadata for %s repository %s changed after reset. \nOld: %s\nNew: %s' % \
(repository.status, repository.name, old_metadata, repository.metadata_)
2 changes: 1 addition & 1 deletion lib/tool_shed/util/shed_util_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def get_requirements_from_repository(repository):
if not repository.includes_tools:
return {}
else:
return get_requirements_from_tools(repository.metadata.get('tools', []))
return get_requirements_from_tools(repository.metadata_.get('tools', []))


def get_repository_categories(app, id):
Expand Down

0 comments on commit a44d779

Please sign in to comment.