• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python test_db_util.get_user函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tool_shed.base.test_db_util.get_user函数的典型用法代码示例。如果您正苦于以下问题:Python get_user函数的具体用法?Python get_user怎么用?Python get_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_user函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_0000_initiate_users

 def test_0000_initiate_users(self):
     """Create necessary user accounts and login as an admin user."""
     """
     We are at step 1.
     Create all the user accounts that are needed for this test script to run independently of other test.
     Previously created accounts will not be re-created.
     """
     self.logout()
     self.login(email=common.test_user_1_email, username=common.test_user_1_name)
     test_user_1 = test_db_util.get_user(common.test_user_1_email)
     assert test_user_1 is not None, (
         "Problem retrieving user with email %s from the database" % common.test_user_1_email
     )
     test_user_1_private_role = test_db_util.get_private_role(test_user_1)
     self.logout()
     self.login(email=common.test_user_2_email, username=common.test_user_2_name)
     test_user_2 = test_db_util.get_user(common.test_user_2_email)
     assert test_user_2 is not None, (
         "Problem retrieving user with email %s from the database" % common.test_user_2_email
     )
     test_user_2_private_role = test_db_util.get_private_role(test_user_2)
     self.logout()
     self.login(email=common.admin_email, username=common.admin_username)
     admin_user = test_db_util.get_user(common.admin_email)
     assert admin_user is not None, "Problem retrieving user with email %s from the database" % common.admin_email
     admin_user_private_role = test_db_util.get_private_role(admin_user)
开发者ID:knowingchaos,项目名称:galaxy,代码行数:26,代码来源:test_0400_repository_component_reviews.py


示例2: test_0070_review_tools

 def test_0070_review_tools(self):
     """Review the tools component for the current tip revision."""
     """
     We are at step 15.
     Log in as test_user_2 and update the review with the tools component given 
     a favorable review, with 5 stars, and approved status.
     # Review this revision: 
     #    Data types (N/A)
     #    Functional tests (One star, comment 'functional tests missing')    
     #    README (N/A)
     #    Repository dependencies (N/A)
     #    Tool dependencies (N/A)
     #    Tools (5 stars, good review)
     """
     self.logout()
     self.login(email=common.test_user_2_email, username=common.test_user_2_name)
     repository = test_db_util.get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
     user = test_db_util.get_user(common.test_user_2_email)
     # The create_repository_review method takes a dict( component label=review contents ).
     # If review_contents is empty, it marks that component as not applicable. The review
     # contents dict should have the structure:
     # {
     #   rating: 1-5,
     #   comment: <text>
     #   approved: yes/no
     #   private: yes/no
     # }
     review_contents_dict = {
         "Tools": dict(rating=5, comment="Excellent tool, easy to use.", approved="yes", private="no")
     }
     self.review_repository(repository, review_contents_dict, test_db_util.get_user(common.test_user_2_email))
开发者ID:knowingchaos,项目名称:galaxy,代码行数:31,代码来源:test_0400_repository_component_reviews.py


示例3: test_0070_review_tools

 def test_0070_review_tools( self ):
     '''Review the tools component for the current tip revision.'''
     self.logout()
     self.login( email=common.test_user_2_email, username=common.test_user_2_name )
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     user = test_db_util.get_user( common.test_user_2_email )
     review_contents_dict = { 'Tools': dict( rating=5, comment='Excellent tool, easy to use.', approved='yes', private='no' ) }
     self.review_repository( repository, review_contents_dict, test_db_util.get_user( common.test_user_2_email ) )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:8,代码来源:test_0400_repository_component_reviews.py


示例4: test_0000_initiate_users

 def test_0000_initiate_users( self ):
     """Create necessary user accounts and login as an admin user."""
     self.login( email=common.test_user_1_email, username=common.test_user_1_name )
     test_user_1 = test_db_util.get_user( common.test_user_1_email )
     assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
     test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
     self.logout()
     self.login( email=common.admin_email, username=common.admin_username )
     admin_user = test_db_util.get_user( common.admin_email )
     assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
     admin_user_private_role = test_db_util.get_private_role( admin_user )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:11,代码来源:test_0000_basic_repository_features.py


示例5: test_0025_load_view_page_for_previous_revision

 def test_0025_load_view_page_for_previous_revision( self ):
     '''Load a citable url for a past changeset revision and verify that strings display.'''
     '''
     We are at step 5.
     Visit the following url and check for appropriate strings: <tool shed base url>/view/user1/filtering_0420/<revision 0>
         Resulting page should not contain change set revision 1, but should contain change set revision 0.
     '''
     global first_changeset_hash
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     test_user_1 = test_db_util.get_user( common.test_user_1_email )
     encoded_user_id = self.security.encode_id( test_user_1.id )
     encoded_repository_id = self.security.encode_id( repository.id )
     # Since twill does not load the contents of an iframe, we need to check that the iframe has been generated correctly,
     # then directly load the url that the iframe should be loading and check for the expected strings.
     # The iframe should point to /repository/view_repository?id=<encoded repository ID>
     strings_displayed = [ '/repository', 'view_repository', 'id=' + encoded_repository_id ]
     strings_displayed_in_iframe = [ 'user1', 'filtering_0420', 'Galaxy filtering tool for test 0420', first_changeset_hash ]
     strings_displayed_in_iframe.append( 'Sharable link to this repository revision:' )
     strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420/%s' % ( self.url, first_changeset_hash ) )
     strings_not_displayed_in_iframe = []
     self.load_citable_url( username='user1', 
                            repository_name='filtering_0420', 
                            changeset_revision=first_changeset_hash, 
                            encoded_user_id=encoded_user_id, 
                            encoded_repository_id=encoded_repository_id,
                            strings_displayed=strings_displayed, 
                            strings_displayed_in_iframe=strings_displayed_in_iframe, 
                            strings_not_displayed_in_iframe=strings_not_displayed_in_iframe )
开发者ID:knowingchaos,项目名称:galaxy,代码行数:28,代码来源:test_0420_citable_urls_for_repositories.py


示例6: test_0020_load_repository_view_page

 def test_0020_load_repository_view_page( self ):
     '''Load the /view/<user>/<repository> page and check for the appropriate strings.'''
     '''
     We are at step 4.
     Visit the following url and check for strings: <tool shed base url>/view/user1/filtering_0420
         Resulting page should contain change set revision 1
     '''
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     test_user_1 = test_db_util.get_user( common.test_user_1_email )
     encoded_user_id = self.security.encode_id( test_user_1.id )
     encoded_repository_id = self.security.encode_id( repository.id )
     # Since twill does not load the contents of an iframe, we need to check that the iframe has been generated correctly,
     # then directly load the url that the iframe should be loading and check for the expected strings.
     # The iframe should point to /repository/bview_repository?id=<encoded repository ID>
     strings_displayed = [ '/repository', 'view_repository', 'id=', encoded_repository_id ]
     strings_displayed_in_iframe = [ 'user1', 'filtering_0420', 'Galaxy filtering tool for test 0420' ]
     strings_displayed_in_iframe.append( self.get_repository_tip( repository ) )
     strings_displayed_in_iframe.append( 'Sharable link to this repository:' )
     strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420' % self.url )
     self.load_citable_url( username='user1', 
                            repository_name='filtering_0420', 
                            changeset_revision=None, 
                            encoded_user_id=encoded_user_id, 
                            encoded_repository_id=encoded_repository_id,
                            strings_displayed=strings_displayed, 
                            strings_displayed_in_iframe=strings_displayed_in_iframe )
开发者ID:knowingchaos,项目名称:galaxy,代码行数:26,代码来源:test_0420_citable_urls_for_repositories.py


示例7: test_0100_verify_reserved_username_handling

 def test_0100_verify_reserved_username_handling( self ):
     '''Check that reserved usernames are handled correctly.'''
     self.logout()
     self.login( email='[email protected]', username='repos' )
     test_user_1 = test_db_util.get_user( '[email protected]' )
     assert test_user_1 is None, 'Creating user with public name "repos" succeeded.'
     self.check_for_strings( strings_displayed=[ 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a public user name.' ] )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:7,代码来源:test_0000_basic_repository_features.py


示例8: test_0035_load_sharable_url_with_invalid_repository_name

 def test_0035_load_sharable_url_with_invalid_repository_name( self ):
     '''Load a citable url with an invalid changeset revision specified.'''
     '''
     We are at step 7
     Visit the following url and check for appropriate strings: <tool shed base url>/view/user1/!!invalid!!
     '''
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     test_user_1 = test_db_util.get_user( common.test_user_1_email )
     encoded_user_id = self.security.encode_id( test_user_1.id )
     tip_revision = self.get_repository_tip( repository )
     # Since twill does not load the contents of an iframe, we need to check that the iframe has been generated correctly,
     # then directly load the url that the iframe should be loading and check for the expected strings.
     # The iframe should point to /repository/browse_repositories?user_id=<encoded user ID>&operation=repositories_by_user
     strings_displayed = [ '/repository', 'browse_repositories', 'user1' ]
     strings_displayed.extend( [ 'list+of+repositories+owned', 'does+not+include+one+named', '%21%21invalid%21%21', 'status=error' ] )
     strings_displayed_in_iframe = [ 'user1', 'filtering_0420' ]
     strings_displayed_in_iframe.append( 'Repositories owned by user1' )
     strings_displayed_in_iframe.append( tip_revision )
     self.load_citable_url( username='user1', 
                            repository_name='!!invalid!!', 
                            changeset_revision=None, 
                            encoded_user_id=encoded_user_id, 
                            encoded_repository_id=None,
                            strings_displayed=strings_displayed, 
                            strings_displayed_in_iframe=strings_displayed_in_iframe )
开发者ID:knowingchaos,项目名称:galaxy,代码行数:25,代码来源:test_0420_citable_urls_for_repositories.py


示例9: test_0135_verify_review_for_new_version

 def test_0135_verify_review_for_new_version(self):
     """Verify that the reviews display correctly for this changeset revision."""
     """
     We are at step 27.
     Log in as test_user_1 and check that the tools component review is for filtering 2.2.0, but that the other component
     reviews had their contents copied from the last reviewed changeset.
     """
     self.logout()
     self.login(email=common.test_user_1_email, username=common.test_user_1_name)
     repository = test_db_util.get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
     user = test_db_util.get_user(common.test_user_2_email)
     strings_displayed = [
         "Data types",
         "Functional tests",
         "yes",
         "A good set of functional tests.",
         "README",
         "yes",
         "Workflows",
         "Tools",
     ]
     strings_displayed.extend(
         ["Clear and concise readme file, a true pleasure to read.", "Tool dependencies", "not_applicable"]
     )
     strings_displayed.extend(
         ["Repository dependencies", "Version 2.2.0 does the impossible and improves this tool."]
     )
     self.verify_repository_reviews(repository, reviewer=user, strings_displayed=strings_displayed)
开发者ID:knowingchaos,项目名称:galaxy,代码行数:28,代码来源:test_0400_repository_component_reviews.py


示例10: test_0110_review_new_changeset_functional_tests

 def test_0110_review_new_changeset_functional_tests(self):
     """Update the filtering repository's readme component review to reflect the presence of the readme file."""
     """
     We are at step 23.
     Log in as test_user_2 and get the last reviewed changeset hash, and pass that and the review id to 
     the create_repository_review method, then update the copied review to approve the functional tests
     component.
     """
     self.logout()
     self.login(email=common.test_user_2_email, username=common.test_user_2_name)
     repository = test_db_util.get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
     user = test_db_util.get_user(common.test_user_2_email)
     # Get the changeset immediately prior to the tip, and pass it to the create review method.
     last_review = self.get_last_reviewed_revision_by_user(user, repository)
     # The create_repository_review method takes a dict( component label=review contents ).
     # If review_contents is empty, it marks that component as not applicable. The review
     # contents dict should have the structure:
     # {
     #   rating: 1-5,
     #   comment: <text>
     #   approved: yes/no
     #   private: yes/no
     # }
     review_contents_dict = {
         "Functional tests": dict(rating=5, comment="A good set of functional tests.", approved="yes", private="no")
     }
     self.create_repository_review(
         repository,
         review_contents_dict,
         changeset_revision=self.get_repository_tip(repository),
         copy_from=(str(last_review.changeset_revision), last_review.id),
     )
开发者ID:knowingchaos,项目名称:galaxy,代码行数:32,代码来源:test_0400_repository_component_reviews.py


示例11: test_0090_upload_readme_file

 def test_0090_upload_readme_file( self ):
     '''Upload a readme file to the filtering repository.'''
     self.logout()
     self.login( email=common.test_user_1_email, username=common.test_user_1_name )
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     user = test_db_util.get_user( common.test_user_2_email )
     self.upload_file( repository, 'readme.txt', commit_message="Uploaded readme.txt" )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:7,代码来源:test_0400_repository_component_reviews.py


示例12: test_0105_upload_test_data

 def test_0105_upload_test_data( self ):
     '''Upload the missing test data to the filtering repository.'''
     self.logout()
     self.login( email=common.test_user_1_email, username=common.test_user_1_name )
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     user = test_db_util.get_user( common.test_user_2_email )
     self.upload_file( repository, 'filtering/filtering_test_data.tar', commit_message="Uploaded test data." )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:7,代码来源:test_0400_repository_component_reviews.py


示例13: test_0080_review_workflows

 def test_0080_review_workflows(self):
     """Review the workflows component for the current tip revision."""
     """
     We are at step 17.
     Log in as test_user_2 and update the review with the workflows component marked as 'Not applicable'.
     # Review this revision: 
     #    Data types (N/A)
     #    Functional tests (One star, comment 'functional tests missing')    
     #    README (N/A)
     #    Repository dependencies (N/A)
     #    Tool dependencies (N/A)
     #    Tools (5 stars, good review)
     #    Workflows (N/A)
     """
     self.logout()
     self.login(email=common.test_user_2_email, username=common.test_user_2_name)
     repository = test_db_util.get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
     user = test_db_util.get_user(common.test_user_2_email)
     # The create_repository_review method takes a dict( component label=review contents ).
     # If review_contents is empty, it marks that component as not applicable. The review
     # contents dict should have the structure:
     # {
     #   rating: 1-5,
     #   comment: <text>
     #   approved: yes/no
     #   private: yes/no
     # }
     review_contents_dict = {"Workflows": dict()}
     self.review_repository(repository, review_contents_dict, user)
开发者ID:knowingchaos,项目名称:galaxy,代码行数:29,代码来源:test_0400_repository_component_reviews.py


示例14: test_0030_review_initial_revision_functional_tests

 def test_0030_review_initial_revision_functional_tests(self):
     """Review the functional tests component for the current tip revision."""
     """
     We are at step 7.
     Log in as test_user_2 and review the functional tests component for this repository. Since the repository 
     has not been altered, this will update the existing review to add a component.
     # Review this revision: 
     #    Data types (N/A)
     #    Functional tests (One star, comment 'functional tests missing')    
     """
     self.logout()
     self.login(email=common.test_user_2_email, username=common.test_user_2_name)
     repository = test_db_util.get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
     user = test_db_util.get_user(common.test_user_2_email)
     # The create_repository_review method takes a dict( component label=review contents ).
     # If review_contents is empty, it marks that component as not applicable. The review
     # contents dict should have the structure:
     # {
     #   rating: 1-5,
     #   comment: <text>
     #   approved: yes/no
     #   private: yes/no
     # }
     review_contents_dict = {
         "Functional tests": dict(rating=1, comment="Functional tests missing", approved="no", private="yes")
     }
     self.review_repository(repository, review_contents_dict, user)
开发者ID:knowingchaos,项目名称:galaxy,代码行数:27,代码来源:test_0400_repository_component_reviews.py


示例15: test_0030_load_sharable_url_with_invalid_changeset_revision

 def test_0030_load_sharable_url_with_invalid_changeset_revision( self ):
     '''Load a citable url with an invalid changeset revision specified.'''
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     test_user_1 = test_db_util.get_user( common.test_user_1_email )
     encoded_user_id = self.security.encode_id( test_user_1.id )
     encoded_repository_id = self.security.encode_id( repository.id )
     invalid_changeset_hash = 'invalid'
     tip_revision = self.get_repository_tip( repository )
     # Since twill does not load the contents of an iframe, we need to check that the iframe has been generated correctly,
     # then directly load the url that the iframe should be loading and check for the expected strings.
     # The iframe should point to /repository/view_repository?id=<encoded repository ID>&status=error
     strings_displayed = [ '/repository', 'view_repository', 'id=' + encoded_repository_id ]
     strings_displayed.extend( [ 'The+change+log', 'does+not+include+revision', invalid_changeset_hash, 'status=error' ] )
     strings_displayed_in_iframe = [ 'user1', 'filtering_0420', 'Galaxy filtering tool for test 0420' ]
     strings_displayed_in_iframe.append( 'Sharable link to this repository revision:' )
     strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420/%s' % ( self.url, invalid_changeset_hash ) )
     strings_not_displayed_in_iframe = []
     self.load_citable_url( username='user1', 
                            repository_name='filtering_0420', 
                            changeset_revision=invalid_changeset_hash, 
                            encoded_user_id=encoded_user_id, 
                            encoded_repository_id=encoded_repository_id,
                            strings_displayed=strings_displayed, 
                            strings_displayed_in_iframe=strings_displayed_in_iframe, 
                            strings_not_displayed_in_iframe=strings_not_displayed_in_iframe )
开发者ID:knowingchaos,项目名称:galaxy,代码行数:25,代码来源:test_0420_citable_urls_for_repositories.py


示例16: test_0040_review_readme

 def test_0040_review_readme( self ):
     '''Review the readme component for the current tip revision.'''
     self.logout()
     self.login( email=common.test_user_2_email, username=common.test_user_2_name )
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     user = test_db_util.get_user( common.test_user_2_email )
     review_contents_dict = { 'README': dict() }
     self.review_repository( repository, review_contents_dict, user )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:8,代码来源:test_0400_repository_component_reviews.py


示例17: test_0030_review_initial_revision_functional_tests

 def test_0030_review_initial_revision_functional_tests( self ):
     '''Review the datatypes component for the current tip revision.'''
     self.logout()
     self.login( email=common.test_user_2_email, username=common.test_user_2_name )
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     user = test_db_util.get_user( common.test_user_2_email )
     review_contents_dict = { 'Functional tests': dict( rating=1, comment='Functional tests missing', approved='no', private='yes' ) }
     self.review_repository( repository, review_contents_dict, user )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:8,代码来源:test_0400_repository_component_reviews.py


示例18: test_0085_verify_workflows_review

 def test_0085_verify_workflows_review( self ):
     '''Verify that the datatypes component review displays correctly.'''
     self.logout()
     self.login( email=common.test_user_1_email, username=common.test_user_1_name )
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     user = test_db_util.get_user( common.test_user_2_email )
     strings_displayed=[ 'Workflows', 'not_applicable' ]
     self.verify_repository_reviews( repository, reviewer=user, strings_displayed=strings_displayed )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:8,代码来源:test_0400_repository_component_reviews.py


示例19: test_0115_verify_functional_tests_review

 def test_0115_verify_functional_tests_review( self ):
     '''Verify that the functional tests component review displays correctly.'''
     self.logout()
     self.login( email=common.test_user_1_email, username=common.test_user_1_name )
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     user = test_db_util.get_user( common.test_user_2_email )
     strings_displayed=[ 'Functional tests', 'yes', 'A good set of functional tests.' ]
     self.verify_repository_reviews( repository, reviewer=user, strings_displayed=strings_displayed )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:8,代码来源:test_0400_repository_component_reviews.py


示例20: test_0100_verify_readme_review

 def test_0100_verify_readme_review( self ):
     '''Verify that the readme component review displays correctly.'''
     self.logout()
     self.login( email=common.test_user_1_email, username=common.test_user_1_name )
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     user = test_db_util.get_user( common.test_user_2_email )
     strings_displayed = [ 'README', 'yes', 'Clear and concise readme file, a true pleasure to read.' ]
     self.verify_repository_reviews( repository, reviewer=user, strings_displayed=strings_displayed )
开发者ID:cidvbi,项目名称:PathogenPortal,代码行数:8,代码来源:test_0400_repository_component_reviews.py



注:本文中的tool_shed.base.test_db_util.get_user函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python basic_util.strip_path函数代码示例发布时间:2022-05-27
下一篇:
Python test_db_util.get_repository_by_name_and_owner函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap