Osintgram
Osintgram copied to clipboard
Fix/updated ig api and added tests
Test Suite Enhancements
This PR adds a comprehensive test suite to the Osintgram project, providing better code reliability and making future contributions easier.
What's New
- Added pytest-based testing framework with proper configuration in pytest.ini
- Created a centralized test fixture system in conftest.py
- Implemented cross-version Python compatibility for tests (works with 3.10 and 3.11)
- Added proper dependency mocking to allow tests to run without installing all dependencies
Added Files
pytest.ini- Configuration for pytestconftest.py- Root-level test setup and dependency mockingtests/__init__.py- Package initializationtests/conftest.py- Test fixtures and setuptests/test_config.py- Tests for configuration handlingtests/test_osintgram.py- Tests for main Osintgram classtests/test_osintgram_mock.py- Mock-based tests for Osintgramtests/test_printcolors.py- Tests for terminal color outputrun_tests.py- Convenience script for running testsrequirements_dev.txt- Development dependencies
Fixed Issues
- Properly mocked external dependencies (geopy, instagram_private_api, prettytable)
- Fixed Python path issues to make tests importable
- Ensured tests can run without network connectivity
- Made tests compatible with different Python versions
Updated Documentation
- Added test running instructions to README.md
- Added Makefile targets for test execution:
make test- Run all testsmake test-cov- Run tests with coveragemake test-docker- Run tests in Docker
Testing
The test suite verifies:
- Configuration loading
- User handling
- Terminal output formatting
- Error handling
- Core functionality of the Osintgram class