Skip to content

Commit 85b4116

Browse files
author
Danielle Jenkins
committed
Add comprehensive test coverage for HTTP/SSE server and docs tools
- HTTP/SSE server: Add tests for app initialization and session management - Docs tools: Add tests for cache functionality, error handling, and network errors - Make components more testable by exposing necessary fields - Add mockito for HTTP testing support - Improve robust error handling in network tests - Add Tower util feature for ServiceExt support
1 parent 2ab71b7 commit 85b4116

File tree

6 files changed

+404
-40
lines changed

6 files changed

+404
-40
lines changed

Cargo.lock

Lines changed: 138 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ tokio = { version = "1", features = ["full"] }
2323
reqwest = { version = "0.11", features = ["json"] }
2424
axum = { version = "0.8", features = ["macros"] }
2525
tokio-util = { version = "0.7", features = ["io", "codec"]}
26-
tower = "0.4"
26+
tower = { version = "0.4", features = ["util"] }
2727
tower-service = "0.3"
28+
hyper = "0.14"
2829

2930
# Serialization and data formats
3031
serde = { version = "1.0", features = ["derive"] }
@@ -41,6 +42,10 @@ futures = "0.3"
4142
rand = "0.8"
4243
clap = { version = "4.4", features = ["derive"] }
4344

45+
[dev-dependencies]
46+
# Testing utilities
47+
mockito = "1.2"
48+
4449
# Main binary with subcommands
4550
[[bin]]
4651
name = "cratedocs"

src/tools/docs/docs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ impl DocCache {
4343

4444
#[derive(Clone)]
4545
pub struct DocRouter {
46-
client: Client,
47-
cache: DocCache,
46+
pub client: Client,
47+
pub cache: DocCache,
4848
}
4949

5050
impl Default for DocRouter {

0 commit comments

Comments
 (0)