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

ninoseki / eml_analyzer / 19261765226

11 Nov 2025 09:52AM UTC coverage: 82.038%. First build
19261765226

Pull #285

github

web-flow
Merge e909d1be5 into f329c52dc
Pull Request #285: refactor: remove InQuest integration

10 of 15 new or added lines in 2 files covered. (66.67%)

982 of 1197 relevant lines covered (82.04%)

0.82 hits per line

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

69.7
/backend/dependencies.py
1
import typing
1✔
2

3
from fastapi import Depends
1✔
4
from redis import Redis
1✔
5

6
from backend import clients, settings
1✔
7

8

9
def get_optional_redis():
1✔
10
    if settings.REDIS_URL:
1✔
NEW
11
        redis: Redis = Redis.from_url(str(settings.REDIS_URL))  # type: ignore
×
12
        try:
×
13
            yield redis
×
14
        finally:
15
            redis.close()
×
16
    else:
17
        yield None
1✔
18

19

20
async def get_optional_vt():
1✔
21
    if settings.VIRUSTOTAL_API_KEY:
1✔
NEW
22
        async with clients.VirusTotal(
×
23
            apikey=str(settings.VIRUSTOTAL_API_KEY)
24
        ) as client:
25
            yield client
×
26
    else:
27
        yield None
1✔
28

29

30
async def get_optional_urlscan():
1✔
31
    if settings.URLSCAN_API_KEY:
1✔
NEW
32
        async with clients.UrlScan(api_key=settings.URLSCAN_API_KEY) as client:
×
33
            yield client
×
34
    else:
35
        yield None
1✔
36

37

38
async def get_optional_email_rep():
1✔
39
    if settings.EMAIL_REP_API_KEY:
1✔
NEW
40
        async with clients.EmailRep(api_key=settings.EMAIL_REP_API_KEY) as client:
×
NEW
41
            yield client
×
42
    else:
43
        yield None
1✔
44

45

46
def get_spam_assassin() -> clients.SpamAssassin:
1✔
47
    return clients.SpamAssassin(
1✔
48
        host=settings.SPAMASSASSIN_HOST,
49
        port=settings.SPAMASSASSIN_PORT,
50
        timeout=settings.SPAMASSASSIN_TIMEOUT,
51
    )
52

53

54
OptionalRedis = typing.Annotated[Redis | None, Depends(get_optional_redis)]
1✔
55
OptionalVirusTotal = typing.Annotated[
1✔
56
    clients.VirusTotal | None, Depends(get_optional_vt)
57
]
58
OptionalUrlScan = typing.Annotated[
1✔
59
    clients.UrlScan | None, Depends(get_optional_urlscan)
60
]
61
OptionalEmailRep = typing.Annotated[clients.EmailRep, Depends(get_optional_email_rep)]
1✔
62
SpamAssassin = typing.Annotated[clients.SpamAssassin, Depends(get_spam_assassin)]
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc