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

Python commands.notfind函数代码示例

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

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



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

示例1: 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


示例2: catalog_find

def catalog_find(searchterm, urlfrag, notfind=False):
    """Just like Twill find, but issues a searchpage-search search"""

    global_dict, local_dict = namespaces.get_twill_glocals()

    # This will navigate us away from the place the Twill script is
    # sitting.  Thus, stash away to the current URL, then navigate
    # back to that URL after searching.
    br = get_browser()
    start_url = br.get_url()

    esc_searchterm = urllib.quote(searchterm)
    url = "/searchresults.html?body=" + esc_searchterm
    commands.go(url)

    # Now do the test.  With the fragment of the URL that was
    # provided, we can do a double-check, to make sure the
    # searchresults provide that.
    if notfind:
        commands.notfind(urlfrag)
    else:
        commands.find(urlfrag)

    # Finally, send them back to the original URL.
    commands.go(start_url)
开发者ID:Falmarri,项目名称:karl,代码行数:25,代码来源:twillcommands.py


示例3: test_logout_web

 def test_logout_web(self):
     self.test_login_web()
     url = 'http://openhatch.org/search/'
     url = make_twill_url(url)
     tc.go(url)
     tc.notfind('log in')
     tc.follow('log out')
     tc.find('log in')
开发者ID:boblannon,项目名称:oh-mainline,代码行数:8,代码来源:tests.py


示例4: test_usernames_case_insensitive

 def test_usernames_case_insensitive(self):
     tc.go(make_twill_url("http://openhatch.org/account/signup/"))
     tc.notfind("already got a user in our database with that username")
     tc.fv("signup", "username", "PaulProteus")
     tc.fv("signup", "email", "[email protected]")
     tc.fv("signup", "password1", "blahblahblah")
     tc.fv("signup", "password2", "blahblahblah")
     tc.submit()
     tc.find("already got a user in our database with that username")
开发者ID:reik,项目名称:oh-mainline,代码行数:9,代码来源:tests.py


示例5: test_reserved_username

 def test_reserved_username(self):
     tc.go(make_twill_url('http://openhatch.org/account/signup/'))
     tc.notfind('That username is reserved.')
     tc.fv('signup', 'username', 'admin')
     tc.fv('signup', 'email', '[email protected]')
     tc.fv('signup', 'password1', 'blahblahblah')
     tc.fv('signup', 'password2', 'blahblahblah')
     tc.submit()
     tc.find('That username is reserved.')
开发者ID:boblannon,项目名称:oh-mainline,代码行数:9,代码来源:tests.py


示例6: delete_project

 def delete_project(self, name):
     """
     Deletes a project
     """
     tc.follow("Delete")
     tc.find("You are removing")
     tc.fv("1", "delete", True)
     tc.submit()
     tc.code(200)
     tc.find("Project deletion complete")
     tc.notfind(name)
开发者ID:JCVI-Cloud,项目名称:galaxy-tools-prok,代码行数:11,代码来源:functional.py


示例7: push_item

def push_item(projectname, summary, comment, status, label):
    go("http://code.google.com/p/%s/issues/list" % (projectname,))
    follow("New Issue")
    fv("3", "summary", summary)
    fv("3", "comment", wraptext(comment))
    fv("3", "status", status)
    fv("3", "labelenter0", label)
    fv("3", "labelenter1", "")

    submit("submit")
    notfind("Letters did not match")
开发者ID:Opngate,项目名称:moinmoin,代码行数:11,代码来源:googlepush.py


示例8: push_item

def push_item(projectname, summary, comment, status, label):
    go('http://code.google.com/p/%s/issues/list' % (projectname, ))
    follow('New Issue')
    fv('3', 'summary', summary)
    fv('3', 'comment', wraptext(comment))
    fv('3', 'status', status)
    fv("3", "labelenter0", label)
    fv("3", "labelenter1", "")

    submit('submit')
    notfind("Letters did not match")
开发者ID:steveyen,项目名称:moingo,代码行数:11,代码来源:googlepush.py


示例9: test_project_member_sharing

    def test_project_member_sharing(self):

        # tests sharing as a member
        tc.go( testlib.PROJECT_LIST_URL )
        tc.find("Logged in as") 
        
        # a project list with member access
        tc.find("Fly data 19") 
        tc.follow("Fly data 19")
        tc.follow("Sharing")
        tc.find("Current members")
        
        # members may not add access
        tc.notfind("Add access")
        tc.follow("<< return to project")
        tc.find("Project: Fly data 19") 
开发者ID:JCVI-Cloud,项目名称:galaxy-tools-prok,代码行数:16,代码来源:functional.py


示例10: send

    def send(self, msg, *send_to):
        web.go(self.SERVICE_URL)
        self._retry_find("editableSmsComposeForm", 5)

        try:
            page = web.get_browser().get_html()
            web.notfind("inputCaptcha")
        except twill.errors.TwillAssertionError, e:
            found = re.search("(/composer/public/jcaptcha\?id=.*)", page)
            assert found
            web.go(found.groups()[0])
            with tempfile.NamedTemporaryFile(suffix=".jpeg") as captcha:
                web.save_html(captcha.name)
                web.back()
                os.system("open %s " % captcha.name)
                web.formvalue("editableSmsComposeForm", "inputCaptcha", raw_input("Captcha: "))
开发者ID:lukmdo,项目名称:smsgates,代码行数:16,代码来源:contrib.py


示例11: make_files

def make_files(pagename):
    redfilename = "/tmp/Red-%s" % pagename
    greenfilename = "/tmp/Green-%s" % pagename
    bluefilename = "/tmp/Blue-%s" % pagename

    # create a small test image.
    gd.gdMaxColors = 256
    i = gd.image((200, 100))
    black = i.colorAllocate((0, 0, 0))
    white = i.colorAllocate((255, 255, 255))
    red = i.colorAllocate((255, 55, 55))
    green = i.colorAllocate((55, 255, 55))
    blue = i.colorAllocate((55, 55, 255))

    # now write a red version
    i.rectangle((0, 0), (199, 99), red, red)
    i.line((0, 0), (199, 99), black)
    i.string(gd.gdFontLarge, (5, 50), pagename, white)
    i.writePng(redfilename)

    # now write a green version
    i.rectangle((0, 0), (199, 99), green, green)
    i.line((0, 0), (99, 99), black)
    i.string(gd.gdFontLarge, (5, 50), pagename, white)
    i.writePng(greenfilename)

    # write a blue version
    i.rectangle((0, 0), (199, 99), blue, blue)
    i.line((0, 0), (99, 199), black)
    i.string(gd.gdFontLarge, (5, 50), pagename, white)
    i.writePng(bluefilename)

    # propose that we delete it (in case it exists)
    t.go(host + "index.php?title=File:%s&action=delete" % pagename)
    # make sure that we've NOT gotten the wrong page and HAVE gotten the right one.
    t.notfind("You are about to delete the file")
    t.find("could not be deleted")

    return (redfilename, greenfilename, bluefilename)
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:39,代码来源:smtest.py


示例12: test_edit_email_address

    def test_edit_email_address(self):
        # Opt out of the periodic emails. This way, the only "checked"
        # checkbox is the one for if the user's email address gets shown.
        paulproteus = Person.objects.get()
        paulproteus.email_me_re_projects = False
        paulproteus.save()

        self.login_with_twill()
        

        _url = 'http://openhatch.org/account/settings/contact-info/'
        url = make_twill_url(_url)

        email = '[email protected]'

        # Go to contact info form
        tc.go(url)

        # Let's first ensure that "[email protected]" doesn't appear on the page.
        # (We're about to add it.)
        tc.notfind('checked="checked"')
        tc.notfind(email)

        # Edit email
        tc.fv("a_settings_tab_form", 'edit_email-email', email)
        # Show email
        tc.fv("a_settings_tab_form", 'show_email-show_email', '1') # [1]
        tc.submit()

        # Form submission ought to redirect us back to the form.
        tc.url(url)

        # Was email successfully edited? 
        tc.find(email)

        # Was email visibility successfully edited? [2]
        tc.find('checked="checked"')

        # And does the email address show up on the profile?
        tc.go(make_twill_url(
                'http://openhatch.org/people/paulproteus'))
        tc.find(email)

        # 2. And when we uncheck, does it go away?
        
        # 2.1. Go to contact info form
        tc.go(url)

        # 2.2. Don't show email
        tc.fv("a_settings_tab_form", 'show_email-show_email', '0') # [1]
        tc.submit()

        # 2.3. Verify it's not on profile anymore
        tc.go(make_twill_url(
                'http://openhatch.org/people/paulproteus'))
        tc.notfind(email)
开发者ID:boblannon,项目名称:oh-mainline,代码行数:56,代码来源:tests.py


示例13: runTest

 def runTest(self):
     """
     The twill test case is useful for emulating a user using HTML forms and clicking on buttons.
     Note we cannot connect to the twill server using urllib2 or any other third party client.
     Also, we cannot verify the header content in a twill response.
     """
     FILTER_FORM = 2
     
     logger = logging.getLogger("TwillTestCase")
     url = URL_BASE
     twill_quiet()
     logger.info('accessing ' + url)
     tc.go(url)
     tc.find("html") # sanity check that this is a html request.
     
     url = URL_BASE + 'filter/'
     logger.info('accessing ' + url)
     tc.go(url)
     tc.formvalue(FILTER_FORM,'tag','esnet')
     tc.submit(9) #simulates a click on the "create filter" button
     tc.find("html")
     tc.find('<table class="sortable">') #a line in event.list.html
     tc.notfind('experiment') #should be filtered out
     
     tc.go(url)
     tc.formvalue(FILTER_FORM,'display','timeline')
     tc.submit(9) #click should direct us to timeline.
     tc.find("html")
     tc.notfind('<table class="sortable">') 
     
     tc.go(url)
     tc.formvalue(FILTER_FORM,'display','json')
     tc.submit(9) #click should give us JSON object.
     tc.find('"pk": 1') #part of JSON string.
     tc.notfind("html")
     
     tc.go(url)
     tc.formvalue(FILTER_FORM,'name','upgrade')
     tc.formvalue(FILTER_FORM,'search','www.es.net')
     tc.formvalue(FILTER_FORM,'description','infrastructure')
     tc.submit(9)
     tc.find('html')
     tc.find('www.es.net') #part of the upgrade event.
     
     #Set headers to contain only the json mime
     tc.clear_extra_headers()
     tc.add_extra_header('Accept',JSON_MIME)
     
     url = URL_BASE
     logger.info('accessing ' + url)
     tc.go(url)
     logger.debug('JSON data:' + tc.show())
     tc.notfind("html") 
     tc.find('"name": "experiment"') #data from the fixture formatted by default serializer
     tc.find('"tags": "esnet"')
     
     url = URL_BASE + '1/'
     logger.info('accessing ' + url)
     tc.go(url)
     tc.notfind("html")
     tc.find('"name": "experiment"') 
     tc.notfind('"tags": "esnet"') 
开发者ID:mmernik,项目名称:net-almanac,代码行数:62,代码来源:tests.py


示例14: test_simple_list_no_dotfiles

def test_simple_list_no_dotfiles(root):
    root.join(".foo-1.0.zip").write("secret")
    go("/simple/")
    notfind("foo")
开发者ID:SAEPython,项目名称:pypiserver4sae,代码行数:4,代码来源:test_app.py


示例15: test_it

 def test_it(self):
     from twill import commands as b
     b.follow('October 1975')
     b.find('1975-10-19')
     b.notfind('1975-12-06')
开发者ID:chrisrossi,项目名称:edwin,代码行数:5,代码来源:test_month.py


示例16: test_packages_list_no_dotdir

def test_packages_list_no_dotdir(root):
    root.mkdir(".subdir").join("foo-1.0.zip").write("secret")
    go("/packages/")
    show()
    notfind("foo")
开发者ID:SAEPython,项目名称:pypiserver4sae,代码行数:5,代码来源:test_app.py


示例17: test_simple_list_no_dotdir

def test_simple_list_no_dotdir(root):
    root.mkdir(".subdir").join("foo-1.0.zip").write("secret")
    go("/simple/")
    show()
    notfind("foo")
开发者ID:SAEPython,项目名称:pypiserver4sae,代码行数:5,代码来源:test_app.py


示例18: test

def test():
    url = twilltestlib.get_url()

    # capture output
    fp = StringIO()
    twill.set_output(fp)

    twill.parse.execute_string('code 200', initial_url=url)

    # from file
    twilltestlib.execute_twill_script('test-go.twill', initial_url=url)

    twill.set_output(None)
    assert fp.getvalue()

    ###

    # from stdin
    filename = os.path.join(twilltestlib.testdir, 'test-go.twill')
    old_in, sys.stdin = sys.stdin, open(filename)
    try:
        twilltestlib.execute_twill_script('-', initial_url=url)
    finally:
        sys.stdin = old_in

    # from parse.execute_file
    twill.parse.execute_file('test-go-exit.twill', initial_url=url)
    
    # also test some failures.

    old_err, sys.stderr = sys.stderr, StringIO()
    try:
        twill.set_errout(sys.stderr)
        #
        # failed assert in a script
        #
        try:
            twill.parse.execute_file('test-go-fail.twill', initial_url=url)
            assert 0
        except TwillAssertionError:
            pass

        commands.go(url)
        try:
            commands.code(400)
            assert 0
        except TwillAssertionError:
            pass

        #
        # no such command (NameError)
        #

        try:
            twill.parse.execute_file('test-go-fail2.twill', initial_url=url)
            assert 0
        except TwillNameError, e:
            pass
    finally:
        sys.stderr = old_err

    namespaces.new_local_dict()
    gd, ld = namespaces.get_twill_glocals()

    commands.go(url)
    try:
        twill.parse.execute_command('url', ('not this',), gd, ld, "anony")
        assert 0, "shouldn't get here"
    except TwillAssertionError:
        pass

    try:
        commands.follow('no such link')
        assert 0, "shouldn't get here"
    except TwillAssertionError:
        pass

    try:
        commands.find('no such link')
        assert 0, "shouldn't get here"
    except TwillAssertionError:
        pass

    try:
        commands.notfind('Hello')
        assert 0, "shouldn't get here"
    except TwillAssertionError:
        pass

    try:
        twill.parse.execute_command('exit', ('0',), gd, ld, "anony")
        assert 0, "shouldn't get here"
    except SystemExit:
        pass
开发者ID:ArtMatt,项目名称:twill-ca,代码行数:94,代码来源:test-go.py


示例19: test_homepage

    def test_homepage(self):
        from twill import commands as b

        b.find("July 1975")
        b.find("1975-12-06")
        b.notfind("New Albums")
开发者ID:chrisrossi,项目名称:edwin,代码行数:6,代码来源:test_home.py


示例20: test_packages_list_no_dotfiles

def test_packages_list_no_dotfiles(root):
    root.join(".foo-1.0.zip").write("secret")
    go("/packages/")
    notfind("foo")
开发者ID:SAEPython,项目名称:pypiserver4sae,代码行数:4,代码来源:test_app.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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