def test_080_add_subfolder2_to_folder2( self ): """Testing adding subfolder2 to a folder2""" # logged in as admin_user name = "Subfolder2" description = "Subfolder2 description" self.add_folder( 'library_admin', self.security.encode_id( library2.id ), self.security.encode_id( folder2.id ), name=name, description=description ) global subfolder2 subfolder2 = get_folder( folder2.id, name, description ) assert subfolder2 is not None, 'Problem retrieving subfolder2 from the database'
def test_160_add_folder6_to_library6( self ): """Testing adding a folder to library6""" # Logged in as admin_user # Add a folder to library5 folder = library6.root_folder name = "folder" description = "folder description" self.add_folder( 'library_admin', self.security.encode_id( library6.id ), self.security.encode_id( folder.id ), name=name, description=description ) global folder6 folder6 = get_folder( folder.id, name, description )
def test_085_add_folder3_to_library3( self ): """Testing adding a folder to library3""" # Logged in as admin_user # Add a folder to library3 folder = library3.root_folder name = "folder" description = "folder description" self.add_folder( 'library_admin', self.security.encode_id( library3.id ), self.security.encode_id( folder.id ), name=name, description=description ) global folder3 folder3 = get_folder( folder.id, name, description )
def test_070_add_folder2_to_library2( self ): """Testing adding folder2 to a library2""" # logged in as admin_user root_folder = library2.root_folder name = "Folder2" description = "Folder2 description" self.add_folder( 'library_admin', self.security.encode_id( library2.id ), self.security.encode_id( root_folder.id ), name=name, description=description ) global folder2 folder2 = get_folder( root_folder.id, name, description ) assert folder2 is not None, 'Problem retrieving folder2 from the database'
def test_020_add_folder_to_library1( self ): """Testing adding a folder1 to a library1""" # logged in as admin_user root_folder = library1.root_folder name = "Folder1" description = "Folder1 description" self.add_folder( 'library_admin', self.security.encode_id( library1.id ), self.security.encode_id( root_folder.id ), name=name, description=description ) global folder1 folder1 = get_folder( root_folder.id, name, description ) assert folder1 is not None, 'Problem retrieving folder1 from the database'
def test_040_add_2nd_folder_to_library1(self): """Testing adding a 2nd folder to a library1""" # logged in as admin_user name = "folder2" description = "folder2 description" self.add_folder('library_admin', self.security.encode_id(library1.id), self.security.encode_id(library1.root_folder.id), name=name, description=description) global folder2 folder2 = get_folder(library1.root_folder.id, name, description) assert folder2 is not None, 'Problem retrieving library folder named "%s" from the database' % name self.browse_library( cntrller='library_admin', library_id=self.security.encode_id(library1.id), strings_displayed=[folder2.name, folder2.description])
def test_035_add_subfolder_to_folder(self): """Testing adding a folder to a folder""" # logged in as admin_user name = "Folder One's Subfolder" description = "This is the Folder One's subfolder" self.add_folder('library_admin', self.security.encode_id(library1.id), self.security.encode_id(folder1.id), name=name, description=description) global subfolder1 subfolder1 = get_folder(folder1.id, name, description) assert subfolder1 is not None, 'Problem retrieving subfolder1 from the database' self.browse_library(cntrller='library_admin', library_id=self.security.encode_id(library1.id), strings_displayed=[ escape(subfolder1.name), escape(subfolder1.description) ])
def test_120_populate_public_library2(self): """Testing library datasets within a library""" # Logged in as admin_user # Add a folder named Three to library2 root root_folder = library2.root_folder name = "One" description = "One description" self.add_folder('library_admin', self.security.encode_id(library2.id), self.security.encode_id(root_folder.id), name=name, description=description) global folder3 folder3 = get_folder(root_folder.id, name, description) assert folder3 is not None, 'Problem retrieving library folder named "%s" from the database' % name # Upload dataset 1.bed to folder One filename = '1.bed' ldda_message = "Testing uploading %s" % filename self.upload_library_dataset( cntrller='library_admin', library_id=self.security.encode_id(library2.id), folder_id=self.security.encode_id(folder3.id), filename=filename, file_type='bed', dbkey='hg18', ldda_message=ldda_message, strings_displayed=['Upload files']) global ldda5 ldda5 = get_latest_ldda_by_name(filename) assert ldda5 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda5 from the database' # Add a sub-folder named Two to folder One name = "Two" description = "Two description" self.add_folder('library_admin', self.security.encode_id(library2.id), self.security.encode_id(folder3.id), name=name, description=description) global folder4 folder4 = get_folder(folder3.id, name, description) assert folder4 is not None, 'Problem retrieving library folder named "%s" from the database' % name # Upload dataset 2.bed to folder Two filename = '2.bed' ldda_message = "Testing uploading %s" % filename self.upload_library_dataset( cntrller='library_admin', library_id=self.security.encode_id(library2.id), folder_id=self.security.encode_id(folder4.id), filename=filename, file_type='bed', dbkey='hg18', ldda_message=ldda_message, strings_displayed=['Upload files']) global ldda6 ldda6 = get_latest_ldda_by_name(filename) assert ldda6 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda6 from the database' # Add a folder named Three to library2 root name = "Three" description = "Three description" self.add_folder('library_admin', self.security.encode_id(library2.id), self.security.encode_id(root_folder.id), name=name, description=description) global folder5 folder5 = get_folder(root_folder.id, name, description) assert folder5 is not None, 'Problem retrieving library folder named "%s" from the database' % name # Upload dataset 3.bed to library2 root folder filename = '3.bed' ldda_message = "Testing uploading %s" % filename self.upload_library_dataset( cntrller='library_admin', library_id=self.security.encode_id(library2.id), folder_id=self.security.encode_id(root_folder.id), filename=filename, file_type='bed', dbkey='hg18', ldda_message=ldda_message, strings_displayed=['Upload files']) global ldda7 ldda7 = get_latest_ldda_by_name(filename) assert ldda7 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda7 from the database'