def test_0025_delete_repository_dependency( self ):
     '''Delete the repository_dependencies.xml from convert_chars_0440.'''
     '''
     We are at simple repository dependencies, steps 5 and 6 - Delete repository_dependencies.xml from convert_chars_0440. 
     Make sure convert_chars_0440 now has two installable revisions: 1 and 2
     '''
     repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
     # Record the current tip, so we can verify that it's still a downloadable revision after repository_dependencies.xml
     # is deleted and a new downloadable revision is created.
     old_changeset_revision = self.get_repository_tip( repository )
     self.delete_files_from_repository( repository, filenames=[ 'repository_dependencies.xml' ] )
     new_changeset_revision = self.get_repository_tip( repository )
     # Check that the old changeset revision is still downloadable.
     metadata_record = self.get_repository_metadata_by_changeset_revision( repository, old_changeset_revision )
     assert metadata_record.downloadable, 'The revision of %s that contains repository_dependencies.xml is no longer downloadable.' % \
         repository.name
     # Check that the new tip is also downloadable.
     metadata_record = self.get_repository_metadata_by_changeset_revision( repository, new_changeset_revision )
     assert metadata_record.downloadable, 'The revision of %s that does not contain repository_dependencies.xml is not downloadable.' % \
         repository.name
     # Explicitly reload the repository instance from the database, to avoid potential caching issues.
     test_db_util.refresh( repository )
     # Verify that there are only two downloadable revisions.
     assert len( repository.downloadable_revisions ) == 2, 'Repository %s has %d downloadable revisions, expected 2.' % \
         ( repository.name, len( repository.downloadable_revisions ) )
Esempio n. 2
0
 def test_0025_delete_repository_dependency(self):
     '''Delete the repository_dependencies.xml from convert_chars_0440.'''
     '''
     We are at simple repository dependencies, steps 5 and 6 - Delete repository_dependencies.xml from convert_chars_0440. 
     Make sure convert_chars_0440 now has two installable revisions: 1 and 2
     '''
     repository = test_db_util.get_repository_by_name_and_owner(
         convert_repository_name, common.test_user_1_name)
     # Record the current tip, so we can verify that it's still a downloadable revision after repository_dependencies.xml
     # is deleted and a new downloadable revision is created.
     old_changeset_revision = self.get_repository_tip(repository)
     self.delete_files_from_repository(
         repository, filenames=['repository_dependencies.xml'])
     new_changeset_revision = self.get_repository_tip(repository)
     # Check that the old changeset revision is still downloadable.
     metadata_record = self.get_repository_metadata_by_changeset_revision(
         repository, old_changeset_revision)
     assert metadata_record.downloadable, 'The revision of %s that contains repository_dependencies.xml is no longer downloadable.' % \
         repository.name
     # Check that the new tip is also downloadable.
     metadata_record = self.get_repository_metadata_by_changeset_revision(
         repository, new_changeset_revision)
     assert metadata_record.downloadable, 'The revision of %s that does not contain repository_dependencies.xml is not downloadable.' % \
         repository.name
     # Explicitly reload the repository instance from the database, to avoid potential caching issues.
     test_db_util.refresh(repository)
     # Verify that there are only two downloadable revisions.
     assert len( repository.downloadable_revisions ) == 2, 'Repository %s has %d downloadable revisions, expected 2.' % \
         ( repository.name, len( repository.downloadable_revisions ) )
Esempio n. 3
0
 def test_0005_create_category_and_repository(self):
     """Create a category for this test suite, then create and populate a bismark repository. It should contain at least one each valid and invalid tool."""
     category = self.create_category(
         name=category_name,
         description='Tests for a repository with invalid tool revisions.')
     self.logout()
     self.login(email=common.test_user_1_email,
                username=common.test_user_1_name)
     repository = self.get_or_create_repository(
         name=repository_name,
         description=repository_description,
         long_description=repository_long_description,
         owner=common.test_user_1_name,
         category_id=self.security.encode_id(category.id),
         strings_displayed=[])
     self.upload_file(repository,
                      'bismark/bismark.tar',
                      valid_tools_only=False,
                      strings_displayed=[],
                      commit_message='Uploaded the tool tarball.')
     self.display_manage_repository_page(
         repository, strings_displayed=['Invalid tools'])
     invalid_revision = self.get_repository_tip(repository)
     self.upload_file(repository,
                      'bismark/bismark_methylation_extractor.xml',
                      valid_tools_only=False,
                      strings_displayed=[],
                      remove_repo_files_not_in_tar='No',
                      commit_message='Uploaded an updated tool xml.')
     valid_revision = self.get_repository_tip(repository)
     test_db_util.refresh(repository)
     self.check_repository_tools_for_changeset_revision(
         repository, valid_revision)
     self.check_repository_invalid_tools_for_changeset_revision(
         repository, invalid_revision)
 def test_0005_create_category_and_repository( self ):
     """Create a category for this test suite, then create and populate a bismark repository. It should contain at least one each valid and invalid tool."""
     category = self.create_category( name=category_name, description='Tests for a repository with invalid tool revisions.' )
     self.logout()
     self.login( email=common.test_user_1_email, username=common.test_user_1_name )
     repository = self.get_or_create_repository( name=repository_name, 
                                                 description=repository_description, 
                                                 long_description=repository_long_description, 
                                                 owner=common.test_user_1_name,
                                                 category_id=self.security.encode_id( category.id ), 
                                                 strings_displayed=[] )
     self.upload_file( repository, 
                       'bismark/bismark.tar', 
                       valid_tools_only=False,
                       strings_displayed=[],
                       commit_message='Uploaded the tool tarball.' )
     self.display_manage_repository_page( repository, strings_displayed=[ 'Invalid tools' ] )
     invalid_revision = self.get_repository_tip( repository )
     self.upload_file( repository, 
                       'bismark/bismark_methylation_extractor.xml', 
                       valid_tools_only=False, 
                       strings_displayed=[],
                       remove_repo_files_not_in_tar='No',
                       commit_message='Uploaded an updated tool xml.' )
     valid_revision = self.get_repository_tip( repository )
     test_db_util.refresh( repository )
     self.check_repository_tools_for_changeset_revision( repository, valid_revision )
     self.check_repository_invalid_tools_for_changeset_revision( repository, invalid_revision )
 def test_0110_delete_filtering_repository( self ):
     '''Delete the filtering_0000 repository and verify that it no longer has any downloadable revisions.'''
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     self.logout()
     self.login( email=common.admin_email, username=common.admin_username )
     self.delete_repository( repository )
     # Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag.
     for metadata_revision in repository.metadata_revisions:
         test_db_util.refresh( metadata_revision )
     # Marking a repository as deleted should result in no metadata revisions being downloadable.
     assert True not in [ metadata.downloadable for metadata in repository.metadata_revisions ]
Esempio n. 6
0
 def test_0005_create_category_and_repository(self):
     """Create a category for this test suite, then create and populate a bismark repository. It should contain at least one each valid and invalid tool."""
     category = self.create_category(name=category_name,
                                     description=category_description)
     self.logout()
     self.login(email=common.test_user_1_email,
                username=common.test_user_1_name)
     repository = self.get_or_create_repository(
         name=repository_name,
         description=repository_description,
         long_description=repository_long_description,
         owner=common.test_user_1_name,
         category_id=self.security.encode_id(category.id),
         strings_displayed=[])
     self.upload_file(repository,
                      filename='bismark/bismark.tar',
                      filepath=None,
                      valid_tools_only=False,
                      uncompress_file=True,
                      remove_repo_files_not_in_tar=False,
                      commit_message='Uploaded bismark tarball.',
                      strings_displayed=[],
                      strings_not_displayed=[])
     self.display_manage_repository_page(
         repository, strings_displayed=['Invalid tools'])
     invalid_revision = self.get_repository_tip(repository)
     self.upload_file(repository,
                      filename='bismark/bismark_methylation_extractor.xml',
                      filepath=None,
                      valid_tools_only=False,
                      uncompress_file=False,
                      remove_repo_files_not_in_tar=False,
                      commit_message='Uploaded an updated tool xml.',
                      strings_displayed=[],
                      strings_not_displayed=[])
     valid_revision = self.get_repository_tip(repository)
     test_db_util.refresh(repository)
     tool_guid = '%s/repos/user1/bismark_0070/bismark_methylation_extractor/0.7.7.3' % self.url.replace(
         'http://', '').rstrip('/')
     tool_metadata_strings_displayed = [
         tool_guid,
         '0.7.7.3',  # The tool version.
         'bismark_methylation_extractor',  # The tool ID.
         'Bismark',  # The tool name.
         'methylation extractor'
     ]  # The tool description.
     tool_page_strings_displayed = ['Bismark (version 0.7.7.3)']
     self.check_repository_tools_for_changeset_revision(
         repository,
         valid_revision,
         tool_metadata_strings_displayed=tool_metadata_strings_displayed,
         tool_page_strings_displayed=tool_page_strings_displayed)
     self.check_repository_invalid_tools_for_changeset_revision(
         repository, invalid_revision)
 def test_0115_undelete_filtering_repository( self ):
     '''Undelete the filtering_0000 repository and verify that it now has two downloadable revisions.'''
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     self.logout()
     self.login( email=common.admin_email, username=common.admin_username )
     self.undelete_repository( repository )
     # Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag.
     for metadata_revision in repository.metadata_revisions:
         test_db_util.refresh( metadata_revision )
     # Marking a repository as undeleted should result in all previously downloadable metadata revisions being downloadable again.
     # In this case, there should be two downloadable revisions, one for filtering 1.1.0 and one for filtering 2.2.0.
     assert True in [ metadata.downloadable for metadata in repository.metadata_revisions ]
     assert len( repository.downloadable_revisions ) == 2
Esempio n. 8
0
 def test_0110_delete_filtering_repository(self):
     '''Delete the filtering_0000 repository and verify that it no longer has any downloadable revisions.'''
     repository = test_db_util.get_repository_by_name_and_owner(
         repository_name, common.test_user_1_name)
     self.logout()
     self.login(email=common.admin_email, username=common.admin_username)
     self.delete_repository(repository)
     # Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag.
     for metadata_revision in repository.metadata_revisions:
         test_db_util.refresh(metadata_revision)
     # Marking a repository as deleted should result in no metadata revisions being downloadable.
     assert True not in [
         metadata.downloadable for metadata in repository.metadata_revisions
     ]
Esempio n. 9
0
 def test_0115_undelete_filtering_repository(self):
     '''Undelete the filtering_0000 repository and verify that it now has two downloadable revisions.'''
     repository = test_db_util.get_repository_by_name_and_owner(
         repository_name, common.test_user_1_name)
     self.logout()
     self.login(email=common.admin_email, username=common.admin_username)
     self.undelete_repository(repository)
     # Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag.
     for metadata_revision in repository.metadata_revisions:
         test_db_util.refresh(metadata_revision)
     # Marking a repository as undeleted should result in all previously downloadable metadata revisions being downloadable again.
     # In this case, there should be two downloadable revisions, one for filtering 1.1.0 and one for filtering 2.2.0.
     assert True in [
         metadata.downloadable for metadata in repository.metadata_revisions
     ]
     assert len(repository.downloadable_revisions) == 2
 def test_0005_create_category_and_repository( self ):
     """Create a category for this test suite, then create and populate a bismark repository. It should contain at least one each valid and invalid tool."""
     category = self.create_category( name=category_name, description=category_description )
     self.logout()
     self.login( email=common.test_user_1_email, username=common.test_user_1_name )
     repository = self.get_or_create_repository( name=repository_name, 
                                                 description=repository_description, 
                                                 long_description=repository_long_description, 
                                                 owner=common.test_user_1_name,
                                                 category_id=self.security.encode_id( category.id ), 
                                                 strings_displayed=[] )
     self.upload_file( repository, 
                       filename='bismark/bismark.tar',
                       filepath=None,
                       valid_tools_only=False,
                       uncompress_file=True,
                       remove_repo_files_not_in_tar=False, 
                       commit_message='Uploaded bismark tarball.',
                       strings_displayed=[], 
                       strings_not_displayed=[] )
     self.display_manage_repository_page( repository, strings_displayed=[ 'Invalid tools' ] )
     invalid_revision = self.get_repository_tip( repository )
     self.upload_file( repository, 
                       filename='bismark/bismark_methylation_extractor.xml',
                       filepath=None,
                       valid_tools_only=False,
                       uncompress_file=False,
                       remove_repo_files_not_in_tar=False, 
                       commit_message='Uploaded an updated tool xml.',
                       strings_displayed=[], 
                       strings_not_displayed=[] )
     valid_revision = self.get_repository_tip( repository )
     test_db_util.refresh( repository )
     tool_guid = '%s/repos/user1/bismark_0070/bismark_methylation_extractor/0.7.7.3' % self.url.replace( 'http://', '' ).rstrip( '/' )
     tool_metadata_strings_displayed = [ tool_guid,
                                         '0.7.7.3', # The tool version.
                                         'bismark_methylation_extractor', # The tool ID.
                                         'Bismark', # The tool name.
                                         'methylation extractor' ] # The tool description.
     tool_page_strings_displayed = [ 'Bismark (version 0.7.7.3)' ]
     self.check_repository_tools_for_changeset_revision( repository, 
                                                         valid_revision, 
                                                         tool_metadata_strings_displayed=tool_metadata_strings_displayed,
                                                         tool_page_strings_displayed=tool_page_strings_displayed )
     self.check_repository_invalid_tools_for_changeset_revision( repository, invalid_revision )