本文整理汇总了Python中tests.expect函数的典型用法代码示例。如果您正苦于以下问题:Python expect函数的具体用法?Python expect怎么用?Python expect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了expect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_update_exist_product_should_response_status_200
def test_update_exist_product_should_response_status_200(self):
product = ProductFactory.create()
data = ProductFactory.attributes()
del data['category']
del data['brand']
resp = self.post('/admin/product/' + str(product.id) + '/update', data)
expect(resp.status_int).to_equal(200)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:7,代码来源:test_admin_product.py
示例2: test_update_an_category_vicious_cycle_should_return_status_400
def test_update_an_category_vicious_cycle_should_return_status_400(self):
category = CategoryWithParentFactory.create()
parent = category.parent
data = CategoryWithParentFactory.attributes()
data['parent'] = category.id;
resp = self.post('/admin/category/' + str(parent.id) + '/update', data)
expect(resp.status_int).to_equal(400)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:7,代码来源:test_admin_category.py
示例3: test_update_an_exist_user_should_be_done
def test_update_an_exist_user_should_be_done(self):
user = UserFactory.create()
data = UserFactory.attributes()
resp = self.post('/admin/user/' + str(user.uid) + '/update', data)
user.reload()
expect(user.username).to_equal(data.get('username'))
expect(user.email).to_include(data.get('email'))
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:7,代码来源:test_admin_user.py
示例4: test_update_an_existing_sticky_should_be_done
def test_update_an_existing_sticky_should_be_done(self):
sticky = StickyFactory.create()
data = StickyFactory.attributes()
resp = self.post('/admin/sticky/' + str(sticky.id) + '/update', data)
sticky.reload()
expect(sticky.name).to_equal(data.get('name'))
expect(sticky.image).to_include(data.get('image'))
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:7,代码来源:test_admin_sticky.py
示例5: test_update_an_existing_brand_should_be_done
def test_update_an_existing_brand_should_be_done(self):
brand = BrandFactory.create()
data = BrandFactory.attributes()
resp = self.post('/admin/brand/' + str(brand.uid) + '/update', data)
brand.reload()
expect(brand.name).to_equal(data.get('name'))
expect(brand.image).to_include(data.get('image'))
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:7,代码来源:test_admin_brand.py
示例6: test_update_an_exist_category_should_response_status_200
def test_update_an_exist_category_should_response_status_200(self):
category = CategoryWithParentFactory.create()
data = CategoryWithParentFactory.attributes()
parent = CategoryFactory.create()
data['parent'] = str(parent['id'])
resp = self.post('/admin/category/' + str(category.id) + '/update', data)
expect(resp.status_int).to_equal(200)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:7,代码来源:test_admin_category.py
示例7: test_create_product_should_response_status_201
def test_create_product_should_response_status_201(self):
product = ProductFactory.attributes()
category = CategoryFactory.create()
brand = BrandFactory.create()
product['category'] = category.id
product['brand'] = brand.id
resp = self.post('/admin/product/',product)
expect(resp.status_int).to_equal(201)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:8,代码来源:test_admin_product.py
示例8: test_update_an_exist_product_should_be_done
def test_update_an_exist_product_should_be_done(self):
product = ProductFactory.create()
data = ProductFactory.attributes()
del data['category']
del data['brand']
resp = self.post('/admin/product/' + str(product.id) + '/update', data)
product.reload()
expect(product.name).to_equal(data.get('name'))
expect(product.sku).to_include(data.get('sku'))
expect(resp).to_include(unicode(data.get('price')))
expect(resp).to_include(data.get('selling_price'))
expect(resp).to_include(data.get('discount'))
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:12,代码来源:test_admin_product.py
示例9: test_update_an_exist_category_should_be_done
def test_update_an_exist_category_should_be_done(self):
category = CategoryWithParentFactory.create()
data = CategoryWithParentFactory.attributes()
data['parent'] = str(category['parent']['id'])
resp = self.post('/admin/category/' + str(category.id) + '/update', data)
expect(resp).to_include(data.get('parent'))
expect(resp).to_include(data.get('name'))
expect(resp).to_include(data.get('image'))
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:8,代码来源:test_admin_category.py
示例10: test_create_a_category_with_parent_should_response_correct_data
def test_create_a_category_with_parent_should_response_correct_data(self):
parent = CategoryFactory.create()
category = CategoryWithParentFactory.attributes()
category['parent'] = parent.id
resp = self.post('/admin/category/', category)
expect(resp).to_include(category.get('name'))
expect(resp).to_include(category.get('image'))
expect(resp).to_include(unicode(category.get('parent')))
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:8,代码来源:test_admin_category.py
示例11: test_create_a_category_with_exist_category_name_sould_response_status_400
def test_create_a_category_with_exist_category_name_sould_response_status_400(self):
category = CategoryWithParentFactory.create()
data = CategoryFactory.attributes()
data['name'] = category.name
resp = self.post('/admin/category/', data)
expect(resp.status_int).to_equal(400)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:6,代码来源:test_admin_category.py
示例12: test_create_a_category_with_not_enough_data_properties_sould_response_status_400
def test_create_a_category_with_not_enough_data_properties_sould_response_status_400(self):
category = CategoryFactory.attributes()
del category['name']
resp = self.post('/admin/category/', category)
expect(resp.status_int).to_equal(400)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:5,代码来源:test_admin_category.py
示例13: test_create_a_category_with_parent_should_response_status_201
def test_create_a_category_with_parent_should_response_status_201(self):
parent = CategoryFactory.create()
category = CategoryWithParentFactory.attributes()
category['parent']=parent.id
resp = self.post('/admin/category/', category)
expect(resp.status_int).to_equal(201)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:6,代码来源:test_admin_category.py
示例14: test_create_a_category_with_empty_parent_should_response_status_201
def test_create_a_category_with_empty_parent_should_response_status_201(self):
category = CategoryFactory.attributes()
resp = self.post('/admin/category/', category)
expect(resp.status_int).to_equal(201)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:4,代码来源:test_admin_category.py
示例15: test_get_not_exist_category_response_status_404
def test_get_not_exist_category_response_status_404(self):
resp = self.get('/admin/category/1001')
expect(resp.status_int).to_equal(404)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:3,代码来源:test_admin_category.py
示例16: test_create_a_brand_should_response_correct_data
def test_create_a_brand_should_response_correct_data(self):
data = BrandFactory.attributes()
resp = self.post('/admin/brand/', data)
expect(resp).to_include(data.get('name'))
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:4,代码来源:test_admin_brand.py
示例17: test_get_not_exist_brand_response_status_404
def test_get_not_exist_brand_response_status_404(self):
resp = self.get('/admin/brand/1001')
expect(resp.status_int).to_equal(404)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:3,代码来源:test_admin_brand.py
示例18: test_create_a_brand_should_response_status_201
def test_create_a_brand_should_response_status_201(self):
data = BrandFactory.attributes()
resp = self.post('/admin/brand/', data)
expect(resp.status_int).to_equal(201)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:4,代码来源:test_admin_brand.py
示例19: test_update_an_category_not_exist_parent_should_return_status_400
def test_update_an_category_not_exist_parent_should_return_status_400(self):
category = CategoryWithParentFactory.create()
data = CategoryWithParentFactory.attributes()
data['parent'] = str(category['parent']['id']) + "10"
resp = self.post('/admin/category/' + str(category.id) + '/update', data)
expect(resp.status_int).to_equal(400)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:6,代码来源:test_admin_category.py
示例20: test_delete_exist_category_should_be_done
def test_delete_exist_category_should_be_done(self):
category = CategoryFactory.create()
resp = self.post('/admin/category/' + str(category.id) + '/delete',{})
expect(len(Category.objects(id=category.id))).to_equal(0)
开发者ID:ngocthuong26189,项目名称:dienthoai,代码行数:4,代码来源:test_admin_category.py
注:本文中的tests.expect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论