本文整理汇总了Python中inc.Commons.Commons.upper方法的典型用法代码示例。如果您正苦于以下问题:Python Commons.upper方法的具体用法?Python Commons.upper怎么用?Python Commons.upper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inc.Commons.Commons
的用法示例。
在下文中一共展示了Commons.upper方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reply_mfw
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import upper [as 别名]
def test_reply_mfw(self):
reply_func = self.function_dispatcher.get_function_by_name("reply")
reply_obj = self.function_dispatcher.get_function_object(reply_func) # type: Reply
# Check MFW produces response
response = reply_obj.passive_run(Function.EVENT_MESSAGE, "MFW",
None, self.server, self.test_user, self.test_chan)
assert "http" in response
# Check multiple times
for _ in range(10):
response = reply_obj.passive_run(Function.EVENT_MESSAGE, "MFW",
None, self.server, self.test_user, self.test_chan)
assert "http" in response
response_url = "http" + response.split("http")[1]
page_request = urllib.request.Request(response_url)
page_opener = urllib.request.build_opener()
resp_data = page_opener.open(page_request).read()
assert len(resp_data) > 0
# Check upper case url
response_url_upper = Commons.upper(response_url)
page_request = urllib.request.Request(response_url_upper)
page_opener = urllib.request.build_opener()
resp_data_upper = page_opener.open(page_request).read()
assert len(resp_data_upper) > 0
示例2: test_upper
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import upper [as 别名]
def test_upper(self):
assert Commons.upper("test words") == "TEST WORDS"
assert Commons.upper("test http://google.com url") == "TEST http://google.com URL"