We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This could be me but I ran into an edge case where I seem to be required to have placebo statements in my application code.
I have a project structure like this:
▶ find . . ./tests ./tests/test_lambda_function.py ./src ./src/lib ./src/lib/__init__.py ./src/lib/foo.py ./src/lambda_function.py
The call to AWS occurs in src/lib/foo.py.
src/lib/foo.py
I initialise placebo in tests/test_lambda_function.py.
tests/test_lambda_function.py
This did not work until I moved these lines into src/lib/foo.py:
boto3.setup_default_session() session = boto3.DEFAULT_SESSION pill = placebo.attach(session, data_path="tests/fixtures") if "BOTO_RECORD" in os.environ: pill.record() elif "BOTO_PLAYBACK" in os.environ: pill.playback()
The file foo has content in it like:
import boto3 client = boto3.client("route53") def get_policy_instance_id(policy_id: str) -> Union[str, None]: response = client.list_traffic_policy_instances() for policy_instance in response["TrafficPolicyInstances"]: if policy_instance["TrafficPolicyId"] == policy_id: return policy_instance["Id"] return None def create(hosted_zone_id: str, ttl: int, domain_name: str, traffic_policy_id: str, traffic_policy_version: int) -> dict: return client.create_traffic_policy_instance( HostedZoneId=hosted_zone_id, Name=domain_name, TTL=ttl, TrafficPolicyId=traffic_policy_id, TrafficPolicyVersion=traffic_policy_version ) ...
Is this a known issue, or am I doing something wrong?
The text was updated successfully, but these errors were encountered:
My apologies, wrong window. This was intended for the Placebo project, not this one.
Sorry, something went wrong.
No branches or pull requests
This could be me but I ran into an edge case where I seem to be required to have placebo statements in my application code.
I have a project structure like this:
The call to AWS occurs in
src/lib/foo.py
.I initialise placebo in
tests/test_lambda_function.py
.This did not work until I moved these lines into
src/lib/foo.py
:The file foo has content in it like:
Is this a known issue, or am I doing something wrong?
The text was updated successfully, but these errors were encountered: