feat: Set up comprehensive Python testing infrastructure with Poetry #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Python Testing Infrastructure
Summary
This PR sets up a complete testing infrastructure for the Glass security reconnaissance tool. The setup uses Poetry as the package manager and pytest as the testing framework, providing a modern and maintainable testing environment.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationrequirements.txtto PoetryTesting Framework
pytest Configuration:
Testing Dependencies (dev group):
pytest ^7.2.0- Core testing frameworkpytest-cov ^4.0.0- Coverage reportingpytest-mock ^3.10.0- Mocking utilitiesProject Structure
Test Fixtures (in conftest.py)
temp_dir- Temporary directory managementmock_config- Mock configuration objectsmock_response- Mock HTTP responsessample_data- Sample test datamock_file_system- Mock file system structuremock_api_client- Mock API clientcapture_logs- Log capture utilitymock_color_output- Colorama mockingmock_proxy_settings- Proxy configuration mockingTest Markers
@pytest.mark.unit- Fast, isolated unit tests@pytest.mark.integration- Integration tests (may require external resources)@pytest.mark.slow- Slow-running testsAdditional Configuration
.gitignorewith testing and Poetry entriesHow to Use
Installation
Running Tests
Writing Tests
tests/unit/tests/integration/conftest.py@pytest.mark.unit, etc.Notes
Validation
All validation tests pass, confirming: