Skip to content

test: add direct unit tests for cloudwatch_client service functions#1

Open
Ghraven wants to merge 2 commits intomainfrom
test/cloudwatch-client-direct-tests
Open

test: add direct unit tests for cloudwatch_client service functions#1
Ghraven wants to merge 2 commits intomainfrom
test/cloudwatch-client-direct-tests

Conversation

@Ghraven
Copy link
Copy Markdown
Owner

@Ghraven Ghraven commented Apr 28, 2026

Closes Tracer-Cloud#885

What

Adds tests/services/test_cloudwatch_client.py with direct unit tests for all three service functions in app/services/cloudwatch_client.py:

  • get_metric_statistics — 5 tests: success path, no boto3, no creds, default statistics, ClientError handling
  • filter_log_events — 5 tests: success, no boto3, no creds, optional params omitted, filter pattern included
  • get_log_events — 5 tests: success, no boto3, no creds, ClientError, time range passed through

15 tests total.

Approach

  • Mocks make_boto3_client() and require_aws_credentials() as specified — no real AWS calls
  • No tool-registration assertions (tool tests are separate)
  • Follows the existing test class pattern in tests/tools/
  • Each test name makes the helper contract explicit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add direct unit tests for app/services/cloudwatch_client.py

1 participant