1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Integration-style tests for the `web` module HTTP handlers.
//!
//! Why: Each submodule exercises a cohesive slice of the handler surface
//! in isolation against an in-process `AppState` backed by a `tempdir` — no
//! live daemon or network required. Splitting by feature area keeps each
//! file under the 500-line cap while preserving all original test coverage.
//! What: Shared test helpers (`test_state`) plus submodules grouping tests
//! by feature area.
//! Test: Run with `cargo test -p trusty-memory`.
use crateAppState;
/// Build a fresh `AppState` rooted in an ephemeral `tempdir`.
///
/// Why: Each test needs an isolated data root so palace creates / drawers
/// never collide across concurrent test threads.
/// What: Creates a `tempdir`, leaks it (so the directory persists for the
/// test's lifetime without being explicitly held), bypasses the project-slug
/// enforcement gate (`TRUSTY_SKIP_PALACE_ENFORCEMENT=1`), and flips the
/// daemon readiness to `Ready` so handlers don't reject requests with a
/// "warming" error.
/// Test: Every test that calls `test_state()`.
pub