Files
scwrypts/py/lib/scwrypts/http/conftest.py
yage 8f3e862086 v4.3.0
=====================================================================

--- Changes ------------------------------

- updated python scwrypts API to use latest pattern established in the
  nodejs library

- SCWRYPTS_ROOT__scwrypts is now supports loading with each run and
  detects managed installations vs manual installations; this now means
  SCWRYPTS_ROOT can no longer be injected to scwrypts (this was a v2
  legacy support thing and probably does not apply to you)

--- New Features -------------------------

- pypi/scwrypts )
     added 'get_generator' API to testing utilities to provide a nice
     way to include default generator options

--- Bug Fixes ----------------------------

- scwrypts groups which use a required environment name regex no longer
  load specialized static files outside of the required environments.
2024-04-16 09:17:40 -06:00

41 lines
1.1 KiB
Python

from types import SimpleNamespace
from pytest import fixture
from scwrypts.test import get_generator
from scwrypts.test.character_set import uri
generate = get_generator({
'str_length_minimum': 8,
'str_length_maximum': 128,
'uuid_output_type': str,
})
def get_request_client_sample_data():
return {
'base_url' : generate(str, {'character_set': uri}),
'endpoint' : generate(str, {'character_set': uri}),
'method' : generate(str),
'response' : generate('requests_Response', {'depth': 4}),
'payload' : generate(dict, {
'depth': 1,
'data_types': { str, 'uuid' },
}),
}
@fixture(name='sample')
def fixture_sample():
return SimpleNamespace(
**get_request_client_sample_data(),
headers = generate(dict, {
'depth': 1,
'data_types': { str, 'uuid' },
}),
payload_headers = generate(dict, {
'depth': 1,
'data_types': { str, 'uuid' },
}),
)