"""
Test basic imports to ensure all modules can be imported correctly
"""
import pytest
import sys
import os

# Add the project root to the Python path
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

def test_import_app():
    """Test that the main app module can be imported"""
    try:
        import app
        assert hasattr(app, 'create_app')
    except ImportError as e:
        pytest.fail(f"Failed to import app module: {e}")

def test_import_crawler():
    """Test that the crawler module can be imported"""
    try:
        import crawler
        assert hasattr(crawler, 'WebsiteCrawler')
    except ImportError as e:
        pytest.fail(f"Failed to import crawler module: {e}")

def test_import_analyzer():
    """Test that the analyzer module can be imported"""
    try:
        import analyzer
        assert hasattr(analyzer, 'MalwareAnalyzer')
    except ImportError as e:
        pytest.fail(f"Failed to import analyzer module: {e}")

def test_import_config():
    """Test that the config module can be imported"""
    try:
        import config
        assert hasattr(config, 'Config')
    except ImportError as e:
        pytest.fail(f"Failed to import config module: {e}")

def test_import_database():
    """Test that the database module can be imported"""
    try:
        import database
        assert hasattr(database, 'init_db')
    except ImportError as e:
        pytest.fail(f"Failed to import database module: {e}")

def test_import_models():
    """Test that the models module can be imported"""
    try:
        import models
        assert hasattr(models, 'ScanJob')
    except ImportError as e:
        pytest.fail(f"Failed to import models module: {e}")
