AWS Auto Inventory uses pytest for testing. To run the tests:
- Install the test dependencies:
pip install -r test_requirements.txt
- Run the tests:
pytest
- Run tests with coverage:
pytest --cov=. tests/
The tests are organized as follows:
-
Unit Tests: Test individual components in isolation
test_api_calls.py
: Tests for API call handling and retry logictest_organization.py
: Tests for organization account discoverytest_role_assumption.py
: Tests for role assumption functionality
-
Integration Tests: Test components working together
test_organization_scanner.py
: Tests for the organization scanning workflowtest_service_scanning.py
: Tests for service scanning functionality
The tests use the moto
library to mock AWS services, allowing tests to run without actual AWS credentials or resources.