edit : 기본 rest서버구조 추가

This commit is contained in:
2025-01-14 17:26:27 +09:00
parent e53282d7e7
commit bd28fcdca4
37 changed files with 4194 additions and 1 deletions

33
rest/tests/test_user.py Normal file
View File

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
"""
@File: test_user.py
@Date: 2020-09-14
@author: A2TEC
@section MODIFYINFO 수정정보
- 수정자/수정일 : 수정내역
- 2022-01-14/hsj100@a2tec.co.kr : refactoring
@brief: test user
"""
from app.database.conn import db
from app.database.schema import Users
def test_create_get_apikey(client, session, login):
"""
레버 로그인
:param client:
:param session:
:return:
"""
key = dict(user_memo='ryan__key')
res = client.post('api/user/apikeys', json=key, headers=login)
res_body = res.json()
assert res.status_code == 200
assert 'secret_key' in res_body
res = client.get('api/user/apikeys', headers=login)
res_body = res.json()
assert res.status_code == 200
assert 'ryan__key' in res_body[0]['user_memo']