File size: 1,505 Bytes
e275025
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""
Test suite for Trans for Doctors project
"""

import pytest
from pathlib import Path


def test_imports():
    """Test that all modules can be imported"""
    try:
        import stt
        import knowledge_base
        import corrector
        import pipeline
        assert True
    except ImportError as e:
        pytest.fail(f"Failed to import module: {e}")


def test_project_structure():
    """Test that all required directories exist"""
    required_dirs = [
        "stt",
        "knowledge_base",
        "corrector",
        "pipeline",
        "results",
        "logs"
    ]
    
    for dir_name in required_dirs:
        dir_path = project_root / dir_name
        assert dir_path.exists(), f"Directory {dir_name} not found"


def test_medical_terms_file():
    """Test that medical terms file exists"""
    terms_file = project_root / "medical_terms.txt"
    assert terms_file.exists(), "medical_terms.txt not found"
    
    # Check it's not empty
    content = terms_file.read_text(encoding='utf-8')
    assert len(content) > 0, "medical_terms.txt is empty"


def test_readme_files():
    """Test that README files exist in all modules"""
    modules_with_readme = [
        "stt",
        "knowledge_base",
        "corrector",
        "pipeline"
    ]
    
    for module in modules_with_readme:
        readme = project_root / module / "README.md"
        assert readme.exists(), f"README.md not found in {module}"


if __name__ == "__main__":
    pytest.main([__file__, "-v"])