本文整理汇总了Python中trac.tests.functional.better_twill.tc.go函数的典型用法代码示例。如果您正苦于以下问题:Python go函数的具体用法?Python go怎么用?Python go使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了go函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: create_milestone
def create_milestone(self, name=None, due=None):
"""Creates the specified milestone, with a random name if none is
provided. Returns the name of the milestone.
"""
if name == None:
name = random_unique_camel()
milestone_url = self.url + "/admin/ticket/milestones"
tc.go(milestone_url)
tc.url(milestone_url)
tc.formvalue('addmilestone', 'name', name)
if due:
# TODO: How should we deal with differences in date formats?
tc.formvalue('addmilestone', 'duedate', due)
tc.submit()
tc.notfind(internal_error)
tc.notfind('Milestone .* already exists')
tc.url(milestone_url)
tc.find(name)
# Make sure it's on the roadmap.
tc.follow('Roadmap')
tc.url(self.url + "/roadmap")
tc.find('Milestone:.*%s' % name)
tc.follow(name)
tc.url('%s/milestone/%s' % (self.url, unicode_quote(name)))
if not due:
tc.find('No date set')
return name
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:29,代码来源:tester.py
示例2: start
def start(self):
"""Starts the webserver, and waits for it to come up."""
if 'FIGLEAF' in os.environ:
exe = os.environ['FIGLEAF']
if ' ' in exe: # e.g. 'coverage run'
args = exe.split()
else:
args = [exe]
else:
args = [sys.executable]
options = ["--port=%s" % self.port, "-s", "--hostname=127.0.0.1",
"--basic-auth=trac,%s," % self.htpasswd]
if 'TRAC_TEST_TRACD_OPTIONS' in os.environ:
options += os.environ['TRAC_TEST_TRACD_OPTIONS'].split()
args.append(os.path.join(self.trac_src, 'trac', 'web',
'standalone.py'))
server = Popen(args + options + [self.tracdir],
stdout=logfile, stderr=logfile,
close_fds=close_fds,
cwd=self.command_cwd,
)
self.pid = server.pid
# Verify that the url is ok
timeout = 30
while timeout:
try:
tc.go(self.url)
break
except ConnectError:
time.sleep(1)
timeout -= 1
else:
raise Exception('Timed out waiting for server to start.')
tc.url(self.url)
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:34,代码来源:testenv.py
示例3: create_component
def create_component(self, name=None, owner=None, description=None):
"""Creates the specified component, with a random camel-cased name if
none is provided. Returns the name."""
if name is None:
name = random_unique_camel()
component_url = self.url + "/admin/ticket/components"
tc.go(component_url)
tc.url(component_url)
tc.formvalue('addcomponent', 'name', name)
if owner is not None:
tc.formvalue('addcomponent', 'owner', owner)
tc.submit()
# Verify the component appears in the component list
tc.url(component_url)
tc.find(name)
tc.notfind(internal_error)
if description is not None:
tc.follow(r"\b%s\b" % name)
tc.formvalue('modcomp', 'description', description)
tc.submit('save')
tc.url(component_url)
tc.find("Your changes have been saved.")
tc.notfind(internal_error)
# TODO: verify the component shows up in the newticket page
return name
开发者ID:dafrito,项目名称:trac-mirror,代码行数:25,代码来源:tester.py
示例4: go_to_wiki
def go_to_wiki(self, name):
"""Surf to the page for the given wiki page."""
# Used to go based on a quickjump, but if the wiki pagename isn't
# camel case, that won't work.
wiki_url = self.url + '/wiki/%s' % name
tc.go(wiki_url)
tc.url(wiki_url)
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:7,代码来源:tester.py
示例5: clone_ticket
def clone_ticket(self, ticketid):
"""Create a clone of the given ticket id using the clone button."""
ticket_url = self.url + '/ticket/%s' % ticketid
tc.go(ticket_url)
tc.url(ticket_url)
tc.formvalue('clone', 'clone', 'Clone')
tc.submit()
# we should be looking at the newly created ticket
self.ticketcount += 1
tc.url(self.url + "/ticket/%s" % self.ticketcount)
return self.ticketcount
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:11,代码来源:tester.py
示例6: _ensure_web_access_is_working
def _ensure_web_access_is_working(self):
timeout = 30
while timeout:
try:
tc.go(self.url)
break
except (ConnectError, BrowserStateError):
time.sleep(1)
timeout -= 1
else:
raise Exception('Timed out waiting for server to start.')
tc.url(self.url)
开发者ID:djangsters,项目名称:agilo,代码行数:12,代码来源:trac_environment.py
示例7: create_version
def create_version(self, name=None, releasetime=None):
"""Create a new version. The name defaults to a random camel-cased
word if not provided."""
version_admin = self.url + "/admin/ticket/versions"
if name == None:
name = random_unique_camel()
tc.go(version_admin)
tc.url(version_admin)
tc.formvalue('addversion', 'name', name)
if releasetime != None:
tc.formvalue('addversion', 'time', releasetime)
tc.submit()
tc.url(version_admin)
tc.find(name)
tc.notfind(internal_error)
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:15,代码来源:tester.py
示例8: create_enum
def create_enum(self, kind, name=None):
"""Helper to create the specified enum (used for ``priority``,
``severity``, etc). If no name is given, a unique random word is used.
The name is returned.
"""
if name == None:
name = random_unique_camel()
priority_url = self.url + "/admin/ticket/" + kind
tc.go(priority_url)
tc.url(priority_url)
tc.formvalue('addenum', 'name', name)
tc.submit()
tc.url(priority_url)
tc.find(name)
tc.notfind(internal_error)
return name
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:16,代码来源:tester.py
示例9: create_component
def create_component(self, name=None, user=None):
"""Creates the specified component, with a random camel-cased name if
none is provided. Returns the name."""
if name == None:
name = random_unique_camel()
component_url = self.url + "/admin/ticket/components"
tc.go(component_url)
tc.url(component_url)
tc.formvalue('addcomponent', 'name', name)
if user != None:
tc.formvalue('addcomponent', 'owner', user)
tc.submit()
# Verify the component appears in the component list
tc.url(component_url)
tc.find(name)
tc.notfind(internal_error)
# TODO: verify the component shows up in the newticket page
return name
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:18,代码来源:tester.py
示例10: go_to_report
def go_to_report(self, id, args=None):
"""Surf to the specified report.
Assumes the report exists. Report variables will be appended if
specified.
:param id: id of the report
:param args: may optionally specify a dictionary of arguments to
be encoded as a query string
"""
report_url = self.url + "/report/%s" % id
if args:
arglist = []
for param, value in args.items():
arglist.append('%s=%s' % (param.upper(), unicode_quote(value)))
report_url += '?' + '&'.join(arglist)
tc.go(report_url)
tc.url(report_url.encode('string-escape').replace('?', '\?'))
开发者ID:dafrito,项目名称:trac-mirror,代码行数:18,代码来源:tester.py
示例11: create_wiki_page
def create_wiki_page(self, page, content=None):
"""Creates the specified wiki page, with random content if none is
provided.
"""
if content == None:
content = random_page()
page_url = self.url + "/wiki/" + page
tc.go(page_url)
tc.url(page_url)
tc.find("The page %s does not exist." % page)
tc.formvalue('modifypage', 'action', 'edit')
tc.submit()
tc.url(page_url + '\\?action=edit')
tc.formvalue('edit', 'text', content)
tc.submit('save')
tc.url(page_url+'$')
# verify the event shows up in the timeline
self.go_to_timeline()
tc.formvalue('prefs', 'wiki', True)
tc.submit()
tc.find(page + ".*created")
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:23,代码来源:tester.py
示例12: go_to_front
def go_to_front(self):
"""Go to the Trac front page"""
tc.go(self.url)
tc.url(self.url)
tc.notfind(internal_error)
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:5,代码来源:tester.py
示例13: go_to_ticket
def go_to_ticket(self, ticketid):
"""Surf to the page for the given ticket ID. Assumes ticket
exists."""
ticket_url = self.url + "/ticket/%s" % ticketid
tc.go(ticket_url)
tc.url(ticket_url)
开发者ID:Stackato-Apps,项目名称:bloodhound,代码行数:6,代码来源:tester.py
示例14: go_to_url
def go_to_url(self, url):
tc.go(url)
tc.url(url)
tc.notfind(internal_error)
开发者ID:dafrito,项目名称:trac-mirror,代码行数:4,代码来源:tester.py
示例15: go_to_url
def go_to_url(self, url):
tc.go(url)
tc.url(re.escape(url))
tc.notfind(internal_error)
开发者ID:pkdevbox,项目名称:trac,代码行数:4,代码来源:tester.py
注:本文中的trac.tests.functional.better_twill.tc.go函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论