Beispiel #1
0
 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'
Beispiel #2
0
 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'
Beispiel #3
0
 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'
Beispiel #4
0
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'])
Beispiel #5
0
 def setup(self):
     email = v['user.email']
     password = v['user.password']
     self.app = Demo()
     self.app.login(email, password)
Beispiel #6
0
 def setup(self):
     account = v['user.account']
     password = v['user.password']
     self.app = Demo()
     self.app.login(account, password)