Skip to content

test: Partial unit tests for Paypal controller; adding requests-mock to dev deps

stephen requested to merge unit-tests--paypal-controller into main

This commit adds partial unit test support for /tordonate/paypal/controller.py and modifies the directory structure and filename convention inside /tordonate/tests to better reflect the structure and layout of files being tested.

  • The folders tests/paypal/ and tests/paypal/json/ were created, and relevant test files moved into these directories from tests.
  • Additionally, tests/paypal/__init__.py was created so that testing tools would search there for Python files.

While this commit only provides partial unit testing for this file, tests for remaining controller methods have been stubbed out to aid organization and completion of test coverage.

In addition to these changes, the test library requests-mock was added to the dev dependencies in pyproject.toml and installed via poetry.lock. This allows for REST API calls to Paypal servers to be mocked while the controller code surrounding these calls can be properly executed for testing.

Merge request reports