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

Python commands.fv函数代码示例

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

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



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

示例1: upload

 def upload(self, input):
     self.get("/tool_runner/index?tool_id=upload1")
     tc.fv("1", "file_type", "bed")
     tc.fv("1", "dbkey", input.get('dbkey', '?'))
     tc.formfile("1", "file_data", input['file_path'])
     tc.submit("runtool_btn")
     tc.code(200)
开发者ID:ARTbio,项目名称:galaxy,代码行数:7,代码来源:check_galaxy.py


示例2: login

def login(username, password):
    t.add_extra_header("User-Agent", "[email protected]")

    t.go(host + "index.php/Special:UserLogin")
    t.fv("1", "wpName", username)
    t.fv("1", "wpPassword", password)
    t.submit("wpLoginAttempt")
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:7,代码来源:smtest.py


示例3: make_intranets

def make_intranets(intranets_name):
    """ Make the offices root hierarchy, deleting if it exists"""

    global_dict, local_dict = namespaces.get_twill_glocals()

    global_dict['intranets_name'] = intranets_name

    # Check to see if we have that community, if so, delete it.
    commands.go('/' + intranets_name)
    br = get_browser()
    status = br.get_code()
    if status != 404:
        # The community shouldn't exist, and so we should get 404
        # looking for it.  If no 404, then it exists and we should
        # delete it.
        url = "/%s/delete.html?confirm=1" % intranets_name
        commands.go(url)

    # Now, make the community and make sure it exists
    commands.go("/add_community.html")
    commands.fv("save", "title", intranets_name)
    desc = "Test intranets root created for Twill test case named '%s'"
    commands.fv("save", "description", desc % test_name)
    commands.submit()
    commands.find("Add Existing")
开发者ID:Falmarri,项目名称:karl,代码行数:25,代码来源:twillcommands.py


示例4: login

def login(username):
    """Find user for given username and make the browser logged in"""

    global_dict, local_dict = namespaces.get_twill_glocals()

    # Set a globabl Twill variable to let Twill scripts now the name
    # of the test, e.g. the directory, as well as community name.
    #global_dict['test_name'] = test_name
    #global_dict['community_name'] = test_name + "-testcase"
    global_dict['cwd'] = os.getcwd()

    hn = global_dict['localhost_url']

    # First logout
    logout()

    # Do a login
    au = global_dict['%s_user' % username]

    # Echo to screen
    dump("Logging into %s as %s" % (hn, au))

    # Continue
    ap = global_dict['%s_password' % username]
    commands.go(hn + '/login.html')
    commands.fv("formLogin", "login", au)
    commands.fv("formLogin", "password", ap)
    commands.submit()

    # Make sure the login succeeded
    commands.show()
    commands.find("My Profile")
开发者ID:Falmarri,项目名称:karl,代码行数:32,代码来源:twillcommands.py


示例5: refresh_form

 def refresh_form(self, control_name, value, form_no=0, form_id=None, form_name=None, **kwd):
     """Handles Galaxy's refresh_on_change for forms without ultimately submitting the form"""
     # control_name is the name of the form field that requires refresh_on_change, and value is
     # the value to which that field is being set.
     for i, f in enumerate(self.showforms()):
         if i == form_no or (form_id is not None and f.id == form_id) or (form_name is not None and f.name == form_name):
             break
     formcontrols = self.get_form_controls(f)
     try:
         control = f.find_control(name=control_name)
     except Exception:
         log.debug('\n'.join(formcontrols))
         # This assumes we always want the first control of the given name, which may not be ideal...
         control = f.find_control(name=control_name, nr=0)
     # Check for refresh_on_change attribute, submit a change if required
     if 'refresh_on_change' in control.attrs.keys():
         # Clear Control and set to proper value
         control.clear()
         tc.fv(f.name, control.name, value)
         # Create a new submit control, allows form to refresh, instead of going to next page
         control = ClientForm.SubmitControl('SubmitControl', '___refresh_grouping___', {'name': 'refresh_grouping'})
         control.add_to_form(f)
         control.fixup()
         # Submit for refresh
         tc.submit('___refresh_grouping___')
开发者ID:osallou,项目名称:galaxy,代码行数:25,代码来源:twilltestcase.py


示例6: test_project_actions

    def test_project_actions(self):
        
        # main page
        tc.go( testlib.PROJECT_LIST_URL )
        tc.find("Logged in as") 

        # default project list
        tc.find("Fly data 19") 
        tc.find("Human HELA 16") 
        tc.find("Mouse project HBB 1") 


        # create a new project
        name = "Rainbow Connection - New Project"
        self.create_project(name=name)

        # visit this new project
        tc.follow(name)
        tc.code(200)
        tc.find("Project: %s" % name)

        # edit and rename project
        newname = "Iguana Garden - New Project"
        tc.follow("Edit")
        tc.find("Edit Project")
        tc.fv("1", "name", newname )
        tc.fv("1", "info", "Some other *markup* goes here")
        tc.submit()
        tc.code(200)
        tc.notfind(name)
        tc.find(newname)

        self.delete_project(name=newname)
开发者ID:JCVI-Cloud,项目名称:galaxy-tools-prok,代码行数:33,代码来源:functional.py


示例7: test_project_manager_sharing

    def test_project_manager_sharing(self):
        # test sharing as a manager

        # main page
        tc.go( testlib.PROJECT_LIST_URL )
        tc.find("Logged in as") 
        
        # default project list
        tc.find("Yeast mutant RAV 17") 
        tc.follow("Yeast mutant RAV 17")
        tc.follow("Sharing")
        tc.find("Current members")
        tc.find("Add access")

        # search for then add Demo User to this project
        tc.fv("1", "text", "demo" )
        tc.submit()
        tc.code(200)
        tc.find("Demo User")
        tc.follow("add as member")
        tc.find("Demo User")

        # back to the project view
        tc.follow("<< return to project")
        tc.find("Yeast mutant RAV 17") 
开发者ID:JCVI-Cloud,项目名称:galaxy-tools-prok,代码行数:25,代码来源:functional.py


示例8: create

 def create(self, cntrller='user', email='[email protected]', password='testuser', username='admin-user', redirect=''):
     # HACK: don't use panels because late_javascripts() messes up the twill browser and it
     # can't find form fields (and hence user can't be logged in).
     params = dict(cntrller=cntrller, use_panels=False)
     self.visit_url("/user/create", params)
     tc.fv('registration', 'email', email)
     tc.fv('registration', 'redirect', redirect)
     tc.fv('registration', 'password', password)
     tc.fv('registration', 'confirm', password)
     tc.fv('registration', 'username', username)
     tc.submit('create_user_button')
     previously_created = False
     username_taken = False
     invalid_username = False
     try:
         self.check_page_for_string("Created new user account")
     except Exception:
         try:
             # May have created the account in a previous test run...
             self.check_page_for_string("User with that email already exists")
             previously_created = True
         except Exception:
             try:
                 self.check_page_for_string('Public name is taken; please choose another')
                 username_taken = True
             except Exception:
                 try:
                     # Note that we're only checking if the usr name is >< 4 chars here...
                     self.check_page_for_string('Public name must be at least 4 characters in length')
                     invalid_username = True
                 except Exception:
                     pass
     return previously_created, username_taken, invalid_username
开发者ID:osallou,项目名称:galaxy,代码行数:33,代码来源:twilltestcase.py


示例9: authenticate

def authenticate(email, pwd):
    print "Authenticating Google Account: %s" % email
    browser.go(AUTH_URL)
    fv("1", "Email", email)
    fv("1", "Passwd", pwd)
    browser.submit()
    code(200)
开发者ID:akvo,项目名称:akvo-flow-data-config,代码行数:7,代码来源:stats.py


示例10: authAndRedirect

def authAndRedirect(username, password):
    tw.reset_browser()
    tw.go(SYS_REDIRECT_URL)
    tw.fv('1', "username", username)
    tw.fv('1', "password", password)
    tw.formaction('1', AUTH_URL)
    tw.submit()
    return tw.get_browser().get_html()
开发者ID:liquiddandruff,项目名称:sfu-coursys-viewer,代码行数:8,代码来源:main.py


示例11: login

    def login(self):
        from twill import commands as b
        b.go('/login')
        b.fv('login', 'login', 'chris')
        b.fv('login', 'password', 'chris')
        b.submit()

        b.find('You are logged in as chris.')
开发者ID:chrisrossi,项目名称:edwin,代码行数:8,代码来源:twillbase.py


示例12: dismod_server_login

def dismod_server_login():
    """ login to the dismod server given in dismod3/settings.py."""

    twc.go(DISMOD_LOGIN_URL)
    twc.fv("1", "username", DISMOD_USERNAME)
    twc.fv("1", "password", DISMOD_PASSWORD)
    twc.submit()
    twc.url("accounts/profile")
开发者ID:flaxter,项目名称:gbd,代码行数:8,代码来源:disease_json.py


示例13: upload_file

 def upload_file(self, fname, ftype='auto', dbkey='hg17'):
     """Uploads a file"""
     fname = self.get_fname(fname)
     tc.go("./tool_runner/index?tool_id=upload1")
     tc.fv("1","file_type", ftype)
     tc.fv("1","dbkey", dbkey)
     tc.formfile("1","file_data", fname)
     tc.submit("runtool_btn")
     self.home()
开发者ID:blankenberg,项目名称:galaxy-central,代码行数:9,代码来源:twilltestcase.py


示例14: submit_form

 def submit_form(self, form=1, button="runtool_btn", **kwd):
     """Populates and submits a form from the keyword arguments"""
     for key, value in kwd.items():
         # needs to be able to handle multiple values per key
         if type(value) != type([]):
             value = [ value ]
         for elem in value:
             tc.fv(str(form), str(key), str(elem) )
     tc.submit(button)
开发者ID:blankenberg,项目名称:galaxy-central,代码行数:9,代码来源:twilltestcase.py


示例15: __create_session

    def __create_session(self):
        browser = get_browser()
        browser.go('http://www.erstenachhilfe.de/user?destination=node%2F767')
        tw.fv('2', 'edit-name', LOGIN)
        tw.fv('2', 'edit-pass', PASSWORD)
        tw.showforms()
        tw.submit('op')

        return browser
开发者ID:asholok,项目名称:adv-crawler,代码行数:9,代码来源:adv_crawler.py


示例16: general_login_action

 def general_login_action(self, username, password, message):
     """ login with given login/password and find given message on page """
     go(SITE)
     code(200)
     fv(1, 'username', username)
     fv(1, 'password', password)
     submit()
     code(200)
     find(message)
开发者ID:xaratt,项目名称:andrytest,代码行数:9,代码来源:test.py


示例17: post_file

def post_file(form, field, file):
    globals, locals = get_twill_glocals()

    test_path = globals.get("test_path")
    file = os.path.join(test_path, file)
    file = open(file)
    body = file.read()
    file.close()
    fv(form, field, body)
开发者ID:socialplanning,项目名称:flunc,代码行数:9,代码来源:zope_run_cat_queue.py


示例18: test_form_sends_data_to_get

 def test_form_sends_data_to_get(self):
     # This test will fail if a query that selects one project but doesn't
     # equal the project's name causes a redirect.
     relevant = mysite.search.models.Project.create_dummy(name='Twisted System')
     tc.go(better_make_twill_url('http://openhatch.org/+projects'))
     query = 'Twisted'
     tc.fv(1, 'search_q', query)
     tc.submit()
     tc.url('\?q=Twisted') # Assert that URL contains this substring.
     tc.find(query)
开发者ID:aishahalim,项目名称:OpenHatch,代码行数:10,代码来源:tests.py


示例19: test_create_confirmation_link

 def test_create_confirmation_link(self):
     """ filling and submitting form on create confirmation link page """
     go(SITE)
     code(200)
     follow("reset password")
     code(200)
     fv(2, 'email', '[email protected]')
     submit()
     code(200)
     find('Please, check your e-mail')
开发者ID:xaratt,项目名称:andrytest,代码行数:10,代码来源:test.py


示例20: add_covariates_to_disease_model

def add_covariates_to_disease_model(dm):
    """
    submit request to dismod server to add covariates to disease model dm
    wait for response (which can take a while)
    """
    dismod_server_login()

    twc.go(DISMOD_BASE_URL + "dismod/run/%d" % dm)
    twc.fv("1", "update", "")
    twc.submit()
开发者ID:flaxter,项目名称:gbd,代码行数:10,代码来源:disease_json.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python commands.get_browser函数代码示例发布时间:2022-05-27
下一篇:
Python commands.formfile函数代码示例发布时间: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