Skip to content

Conversation

@tapiocaboy
Copy link

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 pytest
  • conftest.py - Root-level test setup and dependency mocking
  • tests/__init__.py - Package initialization
  • tests/conftest.py - Test fixtures and setup
  • tests/test_config.py - Tests for configuration handling
  • tests/test_osintgram.py - Tests for main Osintgram class
  • tests/test_osintgram_mock.py - Mock-based tests for Osintgram
  • tests/test_printcolors.py - Tests for terminal color output
  • run_tests.py - Convenience script for running tests
  • requirements_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 tests
    • make test-cov - Run tests with coverage
    • make 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant