Initial commit
This commit is contained in:
commit
9795660e1f
43 changed files with 2757 additions and 0 deletions
0
tests/fixtures/__init__.py
vendored
Normal file
0
tests/fixtures/__init__.py
vendored
Normal file
24
tests/fixtures/data_fixtures.py
vendored
Normal file
24
tests/fixtures/data_fixtures.py
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
|
||||
def _load_data(filename: str):
|
||||
current_file = Path(__file__).resolve()
|
||||
data_path = current_file.parent.parent.joinpath("data")
|
||||
data_file_path = data_path.joinpath(filename)
|
||||
with open(data_file_path, 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
|
||||
return data
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def api_user_data():
|
||||
return _load_data('api_users.json')
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def api_post_data():
|
||||
return _load_data('api_posts.json')
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def api_user_auth_data():
|
||||
return _load_data('api_user_auth.json')
|
||||
Loading…
Add table
Add a link
Reference in a new issue