Skip to content

Add full unit tests for src/trade/api_actions.py#13

Merged
IOITI merged 4 commits intomainfrom
feature/add-full-unit-tests-for-api-actions
Aug 13, 2025
Merged

Add full unit tests for src/trade/api_actions.py#13
IOITI merged 4 commits intomainfrom
feature/add-full-unit-tests-for-api-actions

Conversation

@google-labs-jules
Copy link
Contributor

This change adds a comprehensive unit test suite for the src/trade/api_actions.py module.

The new tests cover all classes and functions in the module, including:

  • SaxoApiClient: Testing token management, request delegation, and exception mapping.
  • InstrumentService: Testing instrument discovery, including the complex find_turbos method.
  • OrderService: Testing order placement, retrieval, and cancellation.
  • PositionService: Testing position and balance retrieval, including the retry logic for finding positions.
  • TradingOrchestrator: Testing the main trade execution workflow and its exception handling.
  • PerformanceMonitor: Testing the position monitoring and automated closure logic.

The test suite uses pytest and unittest.mock to provide extensive coverage of both success and failure scenarios, ensuring the robustness of the trading API actions.

google-labs-jules bot and others added 4 commits August 13, 2025 12:58
Signed-off-by: IOITI <22798250+IOITI@users.noreply.github.com>
…pi_actions.py` module. The new tests cover all classes and functions in the module, including the API client, instrument service, order service, position service, trading orchestrator, and performance monitor. The tests cover happy paths, error conditions, and complex scenarios like retry logic and exception mapping.
…pi_actions.py` module. The new tests cover all classes and functions in the module, including the API client, instrument service, order service, position service, trading orchestrator, and performance monitor. The tests cover happy paths, error conditions, and complex scenarios like retry logic and exception mapping.
@IOITI IOITI marked this pull request as ready for review August 13, 2025 19:41
@IOITI IOITI merged commit 9c4bdf1 into main Aug 13, 2025
1 check passed
@IOITI IOITI deleted the feature/add-full-unit-tests-for-api-actions branch August 13, 2025 19:43
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.

1 participant