Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
quambene committed Apr 5, 2024
1 parent c34ee97 commit bcebd27
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/cmd/test_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

use assert_cmd::Command;
use predicates::str;
use predicates::{boolean::PredicateBooleanExt, str};
use std::fs;
use tempfile::tempdir;

Expand Down Expand Up @@ -90,8 +90,17 @@ fn test_query_save_png() {
"--image-name",
image_name,
]);
cmd.assert().success().stdout(str::contains(format!(
"Save query result to file: {}/1.png",
temp_path.display()
)));
cmd.assert()
.success()
.stdout(
str::contains("Display query result: shape: (1, 2)").and(str::contains(format!(
"Save query result to file: {}/1.png",
temp_path.display()
))),
);

let image_path = temp_path.join("1.png");
let actual = fs::read(image_path).unwrap();
let expected = fs::read("./test_data/test.png").unwrap();
assert_eq!(actual, expected);
}

0 comments on commit bcebd27

Please sign in to comment.