/aws-auto-inventory

AWS Auto Inventory allows you to quickly and easily generate inventory reports of your AWS resources.

Primary LanguagePythonApache License 2.0Apache-2.0

Testing

AWS Auto Inventory uses pytest for testing. To run the tests:

  1. Install the test dependencies:
pip install -r test_requirements.txt
  1. Run the tests:
pytest
  1. Run tests with coverage:
pytest --cov=. tests/

Test Structure

The tests are organized as follows:

  • Unit Tests: Test individual components in isolation

    • test_api_calls.py: Tests for API call handling and retry logic
    • test_organization.py: Tests for organization account discovery
    • test_role_assumption.py: Tests for role assumption functionality
  • Integration Tests: Test components working together

    • test_organization_scanner.py: Tests for the organization scanning workflow
    • test_service_scanning.py: Tests for service scanning functionality

Mocking AWS Services

The tests use the moto library to mock AWS services, allowing tests to run without actual AWS credentials or resources.