Add tests for frontend API (#3552)

### What problem does this PR solve?

Add tests for frontend API

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
This commit is contained in:
liuhua
2024-11-21 15:39:25 +08:00
committed by GitHub
parent 85dd9fde43
commit bf9ebda3c8
23 changed files with 75 additions and 30 deletions

View File

@ -16,9 +16,6 @@ PASSWORD='''ctAseGvejiaSWWZ88T/m4FQVOpQyUvP+x7sXtdv3feqZACiQleuewkUi35E16wSd5C5Q
fN33jCHRoDUW81IH9zjij/vaw8IbVyb6vuwg6MX6inOEBRRzVbRYxXOu1wkWY6SsI8X70oF9aeLFp/PzQpjoe/YbSqpTq8qqrmHzn9vO+yvyYyvmDsphXe
X8f7fp9c7vUsfOCkM+gHY3PadG+QHa7KI7mzTKgUTZImK6BZtfRBATDTthEUbbaTewY4H0MnWiCeeDhcbeQao6cFy1To8pE3RpmxnGnS8BsBn8w=='''
def get_email():
return EMAIL
def register():
url = HOST_ADDRESS + "/v1/user/register"
name = "user"
@ -50,3 +47,12 @@ def get_api_key_fixture():
raise Exception(res.get("message"))
return res["data"].get("token")
@pytest.fixture(scope="session")
def get_auth():
register()
auth = login()
return auth
@pytest.fixture(scope="session")
def get_email():
return EMAIL