# ashrika786/api-testing-python architecture

> Architecture diagram of the GitHub repository ashrika786/api-testing-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashrika786/api-testing-python
- Repository: https://github.com/ashrika786/api-testing-python

## Overview

PyRestAPITest is a Python-based REST API test application. Its documented workflow is to run automated tests with pytest, make API requests, check results, and review execution logs or an HTML report. The sampled code confirms the request, assertion, and logging responsibilities, but does not show how the test files orchestrate them; that connection is therefore left unverified. The README also documents pytest-HTML reporting, whose generation is not implemented in the sampled source.

Main entry points: [`session.py`](https://github.com/ashrika786/api-testing-python/blob/main/session.py) (HTTP session), [`logger.py`](https://github.com/ashrika786/api-testing-python/blob/main/logger.py) (Logger), [`tests/test_stations.py`](https://github.com/ashrika786/api-testing-python/blob/main/tests/test_stations.py) (Station tests), [`asserter.py`](https://github.com/ashrika786/api-testing-python/blob/main/asserter.py) (Assertions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_execution["Test execution"]
  node_test_cases["Station tests<br/>[test_stations.py]"]
  node_test_helpers["Test utilities<br/>[test_utils.py]"]
end

subgraph group_runtime["API test runtime"]
  node_api_session["HTTP session<br/>[session.py]"]
  node_station_endpoint["Stations endpoint<br/>[session.py]"]
  node_assertions["Assertions<br/>[asserter.py]"]
  node_logger["Logger<br/>[logger.py]"]
end

subgraph group_results["Test results"]
  node_execution_log["Execution log<br/>[logger.py]"]
  node_html_report["HTML report<br/>[StationReport.html]"]
end

node_user(("Test author"))
node_virta_api{{"Virta API"}}

node_user -->|"runs tests"| node_test_cases
node_test_cases -.->|"may invoke"| node_api_session
node_api_session -->|"sends request"| node_virta_api
node_api_session -->|"defines endpoint"| node_station_endpoint
node_api_session -->|"logs requests"| node_logger
node_assertions -->|"logs assertions"| node_logger
node_logger -->|"writes log"| node_execution_log
node_user -->|"reviews report"| node_html_report

click node_test_cases "https://github.com/ashrika786/api-testing-python/blob/main/tests/test_stations.py"
click node_test_helpers "https://github.com/ashrika786/api-testing-python/blob/main/test_utils.py"
click node_api_session "https://github.com/ashrika786/api-testing-python/blob/main/session.py"
click node_station_endpoint "https://github.com/ashrika786/api-testing-python/blob/main/session.py"
click node_assertions "https://github.com/ashrika786/api-testing-python/blob/main/asserter.py"
click node_logger "https://github.com/ashrika786/api-testing-python/blob/main/logger.py"
click node_execution_log "https://github.com/ashrika786/api-testing-python/blob/main/logger.py"
click node_html_report "https://github.com/ashrika786/api-testing-python/blob/main/StationReport.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_test_cases,node_test_helpers toneBlue
class node_api_session,node_station_endpoint,node_assertions,node_logger toneAmber
class node_execution_log,node_html_report,node_virta_api toneMint
class node_user toneIndigo
```

## Components

### Test execution

- [Station tests](https://github.com/ashrika786/api-testing-python/blob/main/tests/test_stations.py): `tests/test_stations.py`
- [Test utilities](https://github.com/ashrika786/api-testing-python/blob/main/test_utils.py): `test_utils.py`

### API test runtime

- [HTTP session](https://github.com/ashrika786/api-testing-python/blob/main/session.py): `session.py`
- [Stations endpoint](https://github.com/ashrika786/api-testing-python/blob/main/session.py): `session.py`
- [Assertions](https://github.com/ashrika786/api-testing-python/blob/main/asserter.py): `asserter.py`
- [Logger](https://github.com/ashrika786/api-testing-python/blob/main/logger.py): `logger.py`

### Test results

- [Execution log](https://github.com/ashrika786/api-testing-python/blob/main/logger.py): `logger.py`
- [HTML report](https://github.com/ashrika786/api-testing-python/blob/main/StationReport.html): `StationReport.html`

### Other components

- **Test author**
- **Virta API**

## Connections

- Test author → Station tests: runs tests (evidence: `README.md`)
- Station tests → HTTP session: may invoke
- HTTP session → Virta API: sends request (evidence: `session.py`)
- HTTP session → Stations endpoint: defines endpoint (evidence: `session.py`)
- HTTP session → Logger: logs requests (evidence: `session.py`)
- Assertions → Logger: logs assertions (evidence: `asserter.py`)
- Logger → Execution log: writes log (evidence: `logger.py`)
- Test author → HTML report: reviews report (evidence: `README.md`)
