Skip to content

Commit d370adb

Browse files
committed
test: fix failing tests
1 parent d1aeeb8 commit d370adb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server/http/src/service.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ where
433433
mod tests {
434434
use graph::data::value::{Object, Word};
435435
use graph::prelude::serde_json::json;
436-
use http::header::CONTENT_TYPE;
436+
use http::header::{CONTENT_LENGTH, CONTENT_TYPE};
437437
use http::status::StatusCode;
438438
use hyper::service::Service;
439439
use hyper::{Body, Method, Request};
@@ -555,7 +555,7 @@ mod tests {
555555

556556
let response =
557557
futures03::executor::block_on(service.call(request)).expect("Should return a response");
558-
let errors = test_utils::assert_error_response(response, StatusCode::OK, false);
558+
let errors = test_utils::assert_error_response(response, StatusCode::BAD_REQUEST, false);
559559

560560
let message = errors[0].as_str().expect("Error message is not a string");
561561

@@ -578,6 +578,7 @@ mod tests {
578578
let request = Request::builder()
579579
.method(Method::POST)
580580
.header(CONTENT_TYPE, "text/plain; charset=utf-8")
581+
.header(CONTENT_LENGTH, 100)
581582
.uri(format!(
582583
"http://localhost:8000/subgraphs/id/{}",
583584
subgraph_id
@@ -590,6 +591,8 @@ mod tests {
590591
.await
591592
.unwrap()
592593
.expect("Should return a response");
594+
595+
println!("{:?}", response);
593596
let data = test_utils::assert_successful_response(response);
594597

595598
// The body should match the simulated query result

0 commit comments

Comments
 (0)