Skip to content

Commit

Permalink
ref(test): Use constant for expected request boundary (#2277)
Browse files Browse the repository at this point in the history
Using a constant should make it clearer that this is a predefined,
hardcoded value
  • Loading branch information
szokeasaurusrex authored Nov 28, 2024
1 parent e6e8bf3 commit b2a741e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/integration/debug_files/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,14 @@ fn ensure_correct_chunk_upload() {
#[test]
/// This test verifies a correct chunk upload of multiple debug files.
fn chunk_upload_multiple_files() {
/// This is the boundary used in the expected request file.
/// It was randomly generated when the expected request was recorded.
const EXPECTED_REQUEST_BOUNDARY: &str = "------------------------b26LKrHFvpOPfwMoDhYNY8";

let expected_chunk_body = fs::read(
"tests/integration/_expected_requests/debug_files/upload/chunk_upload_multiple_files.bin",
)
.expect("expected chunk body file should be present");
// This is the boundary used in the expected request file.
// It was randomly generated when the expected request was recorded.
let boundary_of_expected_request = "------------------------b26LKrHFvpOPfwMoDhYNY8";

let is_first_assemble_call = AtomicBool::new(true);
TestManager::new()
Expand All @@ -316,7 +317,7 @@ fn chunk_upload_multiple_files() {

let expected_chunks = chunk_upload::split_chunk_body(
&expected_chunk_body,
boundary_of_expected_request,
EXPECTED_REQUEST_BOUNDARY,
)
.expect("expected chunk body is a valid multipart/form-data body");

Expand Down

0 comments on commit b2a741e

Please sign in to comment.