• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ninoseki / eml_analyzer / 30723413873

01 Aug 2026 11:28PM UTC coverage: 81.938% (-0.9%) from 82.821%
30723413873

push

github

web-flow
Update aug (#372)

* chore: update Python

* chore: sync lockfile

* docs: update README

* fix: apply ruff

* fix: drop syncer

* chore: update secweb

6 of 13 new or added lines in 3 files covered. (46.15%)

998 of 1218 relevant lines covered (81.94%)

0.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.84
/tests/conftest.py
1
import asyncio
1✔
2
import os
1✔
3

4
import aiospamc
1✔
5
import ci
1✔
6
import pytest
1✔
7
from fastapi.testclient import TestClient
1✔
8
from pytest_docker.plugin import Services
1✔
9

10
from backend import clients, factories, schemas
1✔
11
from backend.main import create_app
1✔
12

13

14
@pytest.fixture(scope="session")
1✔
15
def docker_compose_file(pytestconfig):
1✔
16
    return os.path.join(str(pytestconfig.rootdir), "test.docker-compose.yml")
×
17

18

19
def is_spam_assassin_responsive(port: int) -> bool:
1✔
NEW
20
    async def ping() -> bool:
×
NEW
21
        try:
×
NEW
22
            res = await aiospamc.ping(port=port)
×
NEW
23
            return res is not None
×
NEW
24
        except Exception:
×
NEW
25
            return False
×
26

NEW
27
    return asyncio.run(ping())
×
28

29

30
if ci.is_ci():
1✔
31

32
    @pytest.fixture(scope="session", autouse=True)
1✔
33
    def docker_compose():  # type: ignore
1✔
34
        return
1✔
35
else:
36

37
    @pytest.fixture(scope="session", autouse=True)
×
38
    def docker_compose(docker_ip: str, docker_services: Services):
×
39
        port = docker_services.port_for("spamassassin", 783)
×
40
        docker_services.wait_until_responsive(
×
41
            timeout=60.0, pause=0.1, check=lambda: is_spam_assassin_responsive(port)
42
        )
43

44

45
@pytest.fixture
1✔
46
def spam_assassin() -> clients.SpamAssassin:
1✔
47
    return clients.SpamAssassin()
1✔
48

49

50
@pytest.fixture
1✔
51
def sample_eml() -> bytes:
1✔
52
    with open("tests/fixtures/sample.eml", "rb") as f:
1✔
53
        return f.read()
1✔
54

55

56
@pytest.fixture
1✔
57
def cc_eml() -> bytes:
1✔
58
    with open("tests/fixtures/cc.eml", "rb") as f:
1✔
59
        return f.read()
1✔
60

61

62
@pytest.fixture
1✔
63
def multipart_eml() -> bytes:
1✔
64
    with open("tests/fixtures/multipart.eml", "rb") as f:
1✔
65
        return f.read()
1✔
66

67

68
@pytest.fixture
1✔
69
def encrypted_docx_eml() -> bytes:
1✔
70
    with open("tests/fixtures/encrypted_docx.eml", "rb") as f:
1✔
71
        return f.read()
1✔
72

73

74
@pytest.fixture
1✔
75
def content_id_eml() -> bytes:
1✔
76
    with open("tests/fixtures/content_id.eml", "rb") as f:
1✔
77
        return f.read()
1✔
78

79

80
@pytest.fixture
1✔
81
def outer_msg() -> bytes:
1✔
82
    with open("tests/fixtures/outer.msg", "rb") as f:
×
83
        return f.read()
×
84

85

86
@pytest.fixture
1✔
87
def other_msg() -> bytes:
1✔
88
    with open("tests/fixtures/other.msg", "rb") as f:
×
89
        return f.read()
×
90

91

92
@pytest.fixture
1✔
93
def encrypted_docx() -> bytes:
1✔
94
    with open("tests/fixtures/encrypted.docx", "rb") as f:
×
95
        return f.read()
×
96

97

98
@pytest.fixture
1✔
99
def xls_with_macro() -> bytes:
1✔
100
    with open("tests/fixtures/macro.xls", "rb") as f:
×
101
        return f.read()
×
102

103

104
@pytest.fixture
1✔
105
def complete_msg() -> bytes:
1✔
106
    with open("tests/fixtures/complete.msg", "rb") as f:
1✔
107
        return f.read()
1✔
108

109

110
@pytest.fixture
1✔
111
def test_html() -> str:
1✔
112
    with open("tests/fixtures/test.html") as f:
×
113
        return f.read()
×
114

115

116
@pytest.fixture
1✔
117
def dkim_valid_eml() -> bytes:
1✔
118
    with open("tests/fixtures/emails/dkim/valid.eml", "rb") as f:
1✔
119
        return f.read()
1✔
120

121

122
@pytest.fixture
1✔
123
def dkim_invalid_eml() -> bytes:
1✔
124
    with open("tests/fixtures/emails/dkim/invalid.eml", "rb") as f:
1✔
125
        return f.read()
1✔
126

127

128
@pytest.fixture
1✔
129
def dkim_no_signature_eml() -> bytes:
1✔
130
    with open("tests/fixtures/emails/dkim/no_signature.eml", "rb") as f:
1✔
131
        return f.read()
1✔
132

133

134
@pytest.fixture
1✔
135
def docx_attachment(encrypted_docx_eml: bytes) -> schemas.Attachment:
1✔
136
    eml = factories.EmlFactory().call(encrypted_docx_eml)
1✔
137
    return eml.attachments[0]
1✔
138

139

140
@pytest.fixture
1✔
141
def client() -> TestClient:
1✔
142
    app = create_app()
1✔
143
    return TestClient(app)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc