本文整理汇总了Python中kay.utils.test.Client.open方法的典型用法代码示例。如果您正苦于以下问题:Python Client.open方法的具体用法?Python Client.open怎么用?Python Client.open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kay.utils.test.Client
的用法示例。
在下文中一共展示了Client.open方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TsuhanTest
# 需要导入模块: from kay.utils.test import Client [as 别名]
# 或者: from kay.utils.test.Client import open [as 别名]
class TsuhanTest(GAETestBase):
CLEANUP_USED_KIND = False
USE_PRODUCTION_STUBS = True
KIND_NAME_UNSWAPPED=False
USE_REMOTE_STUBS=False
def setUp(self):
init_recording()
app = get_application()
self.client = Client(app, BaseResponse)
self.client.test_login()
def tearDown(self):
self.client.test_logout()
disable_recording()
def test_index(self):
response = self.client.open(
path=url_for('core/index'),
method='GET',
data=dict(),
)
self.assertEqual(response.status_code, 200)
def test_products(self):
response = self.client.open(
path=url_for('core/products',category_code='01',list_per_page=20,page_index=0),
method='GET',
data=dict(),
)
self.assertEqual(response.status_code, 200)
def test_tags(self):
response = self.client.open(
path=url_for('core/tags',tags=u'タグ',list_per_page=20,page_index=0),
method='GET',
data=dict(),
)
self.assertEqual(response.status_code, 200)
def test_search(self):
response = self.client.open(
path=url_for('core/search',words=u'検索ワード',list_per_page=20,page_index=0),
method='GET',
data=dict(),
)
self.assertEqual(response.status_code, 200)
def test_detail(self):
response = self.client.open(
path=url_for('core/detail',article_id='421135'),
method='GET',
data=dict(),
)
self.assertEqual(response.status_code, 200)
def test_sitemap(self):
response = self.client.open(
path=url_for('core/sitemap'),
method='GET',
data=dict(),
)
self.assertEqual(response.status_code, 404)