37 lines
700 B
Python
37 lines
700 B
Python
import json
|
|
from unittest.mock import Mock
|
|
|
|
import pytest
|
|
from pyinfra.locations import TEST_DIR
|
|
|
|
|
|
@pytest.fixture
|
|
def bucket_name():
|
|
return "pyinfra-test-bucket"
|
|
|
|
|
|
@pytest.fixture
|
|
def storage_data():
|
|
with open(f"{TEST_DIR}/test_data/test_data.TEXT.json", "r") as f:
|
|
data = json.load(f)
|
|
return data
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_response(storage_data):
|
|
response = Mock(status_code=200)
|
|
response.json.return_value = storage_data
|
|
return response
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_payload():
|
|
return json.dumps({"dossierId": "test", "fileId": "test"})
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_make_load_data():
|
|
def load_data(payload):
|
|
return storage_data
|
|
return load_data
|