Test Mapping - Source Code ↔ TestsΒΆ

Complete mapping of source files to unit and integration tests

Last updated: 2026-01-29 Version: 0.1.1 Status: Updated to reflect existing tests in tests/unit/


πŸ“‹ Table of ContentsΒΆ

  1. Executive Summary

  2. Organization Principle

  3. Complete Mapping

  4. Coverage Status

  5. Pending Tests

  6. Guide for New Tests


πŸ“Š Executive SummaryΒΆ

Current Test StatusΒΆ

Category

Total Files

With Unit Tests

With Int Tests

Unit Coverage

Int Coverage

CLIENT

5

4/5 (80%)

0/5 (0%)

βœ… High (Files)

0%

HTTP

4

4/4 (100%)

0/4 (0%)

βœ… High (Files)

0%

TRANSPORT

3

3/3 (100%)

0/3 (0%)

βœ… High (Files)

0%

UTILS

4

4/4 (100%)

0/4 (0%)

βœ… High (Files)

0%

CORE

2

2/2 (100%)

0/2 (0%)

100%

0%

TOTAL

18

17/18 (94% files)

0/18 (0%)

~90% (Est.)

0%

Note: β€œ94% files” = percentage of files that have a dedicated test file. Actual line coverage needs verification via pytest --cov.

⚠️ Status: Unit tests are largely implemented. Focus shifts to Integration Tests and the missing test_auth.py.


🎯 Organization Principle¢

We follow ADR-014: Test Structure Organization:

1:1 Mapping RuleΒΆ

Each source file must have:

  1. A corresponding unit test file (Mostly complete!)

  2. At least one integration test using it in real context (Pending)

Directory StructureΒΆ

src/reqivo/                      tests/
β”œβ”€β”€ client/                      β”œβ”€β”€ unit/
β”‚   β”œβ”€β”€ session.py      ────────►│   β”œβ”€β”€ test_session.py      βœ…
β”‚   β”œβ”€β”€ request.py      ────────►│   β”œβ”€β”€ test_request.py      βœ…
β”‚   β”œβ”€β”€ response.py     ────────►│   β”œβ”€β”€ test_response.py     βœ…
β”‚   β”œβ”€β”€ websocket.py    ────────►│   β”œβ”€β”€ test_websocket.py    βœ…
β”‚   └── auth.py         ────────►│   └── (MISSING)            ❌
β”‚                                β”‚
β”œβ”€β”€ http/                        β”‚
β”‚   β”œβ”€β”€ http11.py       ────────►│   β”œβ”€β”€ test_http_parser.py  βœ…
β”‚   β”œβ”€β”€ headers.py      ────────►│   β”œβ”€β”€ test_headers.py      βœ…
β”‚   β”œβ”€β”€ body.py         ────────►│   β”œβ”€β”€ test_body.py         βœ…
β”‚   └── url.py          ────────►│   β”œβ”€β”€ test_url.py          βœ…
β”‚                                β”‚
β”œβ”€β”€ transport/                   β”‚
β”‚   β”œβ”€β”€ connection.py   ────────►│   β”œβ”€β”€ test_connection.py   βœ…
β”‚   β”œβ”€β”€ connection_pool.py ─────►│   β”œβ”€β”€ test_connection_pool.py βœ…
β”‚   └── tls.py          ────────►│   β”œβ”€β”€ test_tls.py          βœ…
β”‚                                β”‚
β”œβ”€β”€ utils/                       β”‚
β”‚   β”œβ”€β”€ timing.py       ────────►│   β”œβ”€β”€ test_timing.py       βœ…
β”‚   β”œβ”€β”€ validators.py   ────────►│   β”œβ”€β”€ test_utils.py (Combined) βœ…
β”‚   β”œβ”€β”€ websocket_utils.py ─────►│   β”œβ”€β”€ test_websocket_utils.py βœ…
β”‚   └── serialization.py ───────►│   β”œβ”€β”€ test_utils.py (Combined) βœ…
β”‚                                β”‚
β”œβ”€β”€ exceptions.py       ────────►│   β”œβ”€β”€ test_exceptions.py   βœ…
└── version.py          ────────►│   └── test_version.py      βœ…
                                 β”‚
                                 β”œβ”€β”€ integration/
                                 β”‚   └── test_placeholder.py  ⚠️ (Need real tests)
                                 β”‚
                                 └── utils/
                                     └── (Helpers to be documented)

πŸ—ΊοΈ Complete MappingΒΆ

1. CLIENT LAYER (src/reqivo/client/)ΒΆ

1.1 session.pyΒΆ

Source: src/reqivo/client/session.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_session.py Status: Implemented. Needs coverage verification.

1.2 request.pyΒΆ

Source: src/reqivo/client/request.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_request.py Status: Implemented.

1.3 response.pyΒΆ

Source: src/reqivo/client/response.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_response.py Status: Implemented.

1.4 websocket.pyΒΆ

Source: src/reqivo/client/websocket.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_websocket.py Status: Implemented.

1.5 auth.pyΒΆ

Source: src/reqivo/client/auth.py Unit Tests: ❌ PENDING β†’ tests/unit/test_auth.py Status: Missng. High Priority for next steps.


2. HTTP LAYER (src/reqivo/http/)ΒΆ

2.1 http11.pyΒΆ

Source: src/reqivo/http/http11.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_http_parser.py Status: Implemented.

2.2 headers.pyΒΆ

Source: src/reqivo/http/headers.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_headers.py Status: Implemented.

2.3 body.pyΒΆ

Source: src/reqivo/http/body.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_body.py Status: Implemented.

2.4 url.pyΒΆ

Source: src/reqivo/http/url.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_url.py Status: Implemented.


3. TRANSPORT LAYER (src/reqivo/transport/)ΒΆ

3.1 connection.pyΒΆ

Source: src/reqivo/transport/connection.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_connection.py Status: Implemented.

3.2 connection_pool.pyΒΆ

Source: src/reqivo/transport/connection_pool.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_connection_pool.py Status: Implemented.

3.3 tls.pyΒΆ

Source: src/reqivo/transport/tls.py Unit Tests: βœ… EXISTING β†’ tests/unit/test_tls.py Status: Implemented.


4. UTILS LAYER (src/reqivo/utils/)ΒΆ

4.1-4.4 UtilsΒΆ

  • timing.py: βœ… tests/unit/test_timing.py

  • validators.py: βœ… tests/unit/test_utils.py (Functional tests)

  • websocket_utils.py: βœ… tests/unit/test_websocket_utils.py

  • serialization.py: βœ… tests/unit/test_utils.py (Functional tests)


5. CORE MODULESΒΆ

  • exceptions.py: βœ… tests/unit/test_exceptions.py

  • version.py: βœ… tests/unit/test_version.py


πŸ“ˆ Coverage StatusΒΆ

Coverage by ModuleΒΆ

Module

Unit Tests

Status

client/session.py

βœ… test_session.py

βœ… OK

client/request.py

βœ… test_request.py

βœ… OK

client/response.py

βœ… test_response.py

βœ… OK

client/websocket.py

βœ… test_websocket.py

βœ… OK

client/auth.py

❌ Missing

πŸ”΄ PENDING

http/http11.py

βœ… test_http_parser.py

βœ… OK

http/ other*

βœ… Individual tests

βœ… OK

transport/connection

βœ… test_connection.py

βœ… OK

transport/pool

βœ… test_connection_pool.py

βœ… OK

transport/tls

βœ… test_tls.py

βœ… OK

Pending Tests PrioritizationΒΆ

πŸ”₯ HIGH PRIORITY (Critical)ΒΆ

  1. client/auth.py - Missing Unit Tests.

  2. Integration Tests - All missing. Need to create real flows.

πŸ”Έ MEDIUM PRIORITYΒΆ

  1. Verify Coverage - Run pytest --cov to ensure 97% is met in these existing files.


πŸ“ Pending TestsΒΆ

Pending Unit TestsΒΆ

tests/unit/test_auth.py  ← πŸ”₯ PRIORITY 1 (Missing)

Pending Integration TestsΒΆ

# Still required to prove components work together
tests/integration/test_http_flow.py
tests/integration/test_session_flow.py
tests/integration/test_websocket_flow.py
tests/integration/test_connection_pooling.py
tests/integration/test_tls_flow.py
tests/integration/test_timeout_flow.py

End of Test Mapping