diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/search.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/search.rs b/tests/search.rs index 7ba9791..5197ffd 100644 --- a/tests/search.rs +++ b/tests/search.rs @@ -25,12 +25,14 @@ const FIXTURE: &str = include_str!("../test/data/search_alcohol_phenotype.json") /// Stands in for gn3's /api/search during tests. async fn serve_gn3(Query(params): Query<HashMap<String, String>>) -> (StatusCode, String) { if params.get("query").is_some_and(|q| q.contains("&&")) { - // Mirrors gn3's shape for unparseable xapian queries. + // Mirrors production gn3's shape for rejected xapian queries + // (live-checked Oct 4): the diagnostic is under "error" and + // "error_type" leaks a Python repr. return ( StatusCode::BAD_REQUEST, json!({ - "error": "parsererror", - "error_message": "Syntax error in query: unexpected &&" + "error": "Syntax: <expression> AND <expression>", + "error_type": "b'QueryParserError'" }) .to_string(), ); @@ -99,7 +101,7 @@ async fn search_proxy_scenarios() { body["detail"] .as_str() .unwrap() - .contains("Syntax error in query") + .contains("Syntax: <expression> AND <expression>") ); // 4. limit is capped: ask for more than 100, the stub still sees a |
