#!/usr/bin/env python3 """ Simple test without external dependencies """ import json import sys from pathlib import Path def test_data_loading(): """Test if data.json can be loaded.""" try: with open("data.json", "r") as f: data = json.load(f) print(f"โœ… Successfully loaded {len(data)} website configurations") # Show a few examples examples = list(data.keys())[:5] print(f"๐Ÿ“‹ Example websites: {', '.join(examples)}") return True except Exception as e: print(f"โŒ Failed to load data.json: {e}") return False def test_project_structure(): """Test if project structure is correct.""" required_files = [ "data.json", "app.py", "pyproject.toml", "requirements.txt", "README.md", "src/sherlock/__init__.py", "src/sherlock/core/search_engine.py", "src/sherlock/web/gradio_interface.py", "src/sherlock/config/settings.py", "src/sherlock/utils/output.py" ] missing_files = [] for file_path in required_files: if not Path(file_path).exists(): missing_files.append(file_path) if missing_files: print(f"โŒ Missing files: {', '.join(missing_files)}") return False else: print(f"โœ… All {len(required_files)} required files present") return True def main(): """Run simple tests.""" print("๐Ÿงช Simple Sherlock OSINT Tool Test") print("=" * 40) tests = [ ("Project Structure", test_project_structure), ("Data Loading", test_data_loading), ] passed = 0 for test_name, test_func in tests: print(f"\n๐Ÿ”„ Running {test_name} test...") if test_func(): passed += 1 print(f"โœ… {test_name} test PASSED") else: print(f"โŒ {test_name} test FAILED") print("\n" + "=" * 40) print(f"๐Ÿ“Š Results: {passed}/{len(tests)} tests passed") if passed == len(tests): print("๐ŸŽ‰ Basic structure test passed!") print("\n๐Ÿ“‹ Next steps:") print("1. Install UV: curl -LsSf https://astral.sh/uv/install.sh | sh") print("2. Install dependencies: uv sync") print("3. Run the tool: uv run python app.py") else: print("โš ๏ธ Some tests failed. Please check the project structure.") if __name__ == "__main__": main()