def test_login_success(self): """ 测试登录成功场景 """ account = v['user.account'] password = v['user.password'] app = Demo() res = app.login(account, password)._json() assert res['code'] == 10000 assert res['msg'] == 'login success'
def test_login_with_error_password(self): """ 测试使用错误的密码登录 """ email = v['user.account'] password = '******' app = Demo() res = app.login(email, password)._json() assert res['code'] == 20000 assert res['msg'] == 'login fail, password error'
def test_login_success(self): """ 测试登录成功场景 """ email = v['user.email'] password = v['user.password'] app = Demo() res = app.login(email, password).json() assert res['code'] == 10000 assert res['msg'] == 'login success'
class TestBookList: def setup(self): email = v['user.email'] password = v['user.password'] self.app = Demo() self.app.login(email, password) def test_get_book_list(self): res = self.app.get_book_list().json() assert if_list_equal(['python', 'java', 'javascript', 'go'], res['data'])
def setup(self): email = v['user.email'] password = v['user.password'] self.app = Demo() self.app.login(email, password)
def setup(self): account = v['user.account'] password = v['user.password'] self.app = Demo() self.app.login(account, password)