summaryrefslogtreecommitdiffstats
path: root/rust/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-21 17:09:10 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-21 17:09:10 -0800
commitc1c01caf6b40343bd876e10961829e2b15a9c37c (patch)
treecb26627fe194cbd878ad9c5912dce2feef2c1c8d /rust/tests
parent86f37a5df6f94d7736be736d0a440ae65425d6c9 (diff)
downloadfatcat-c1c01caf6b40343bd876e10961829e2b15a9c37c.tar.gz
fatcat-c1c01caf6b40343bd876e10961829e2b15a9c37c.zip
verify checksum against regexes
Diffstat (limited to 'rust/tests')
-rw-r--r--rust/tests/test_api_server_http.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/rust/tests/test_api_server_http.rs b/rust/tests/test_api_server_http.rs
index 031a0abf..714cfc68 100644
--- a/rust/tests/test_api_server_http.rs
+++ b/rust/tests/test_api_server_http.rs
@@ -267,7 +267,7 @@ fn test_lookups() {
check_http_response(
request::get(
- "http://localhost:9411/v0/file/lookup?md5=7d97e98f8af710c7e7fe703abc8f639e0ee507c4",
+ "http://localhost:9411/v0/file/lookup?md5=00000000000ab9fdc2a128f962faebff",
headers.clone(),
&router,
),
@@ -276,6 +276,15 @@ fn test_lookups() {
);
check_http_response(
request::get(
+ "http://localhost:9411/v0/file/lookup?md5=00000000000ab9fdc2a128f962faebfff",
+ headers.clone(),
+ &router,
+ ),
+ status::BadRequest,
+ None,
+ );
+ check_http_response(
+ request::get(
"http://localhost:9411/v0/file/lookup?md5=f4de91152c7ab9fdc2a128f962faebff",
headers.clone(),
&router,
@@ -304,7 +313,7 @@ fn test_lookups() {
check_http_response(
request::get(
- "http://localhost:9411/v0/file/lookup?sha1=7d97e98f8af710c7e7fe703abc8f000000000000",
+ "http://localhost:9411/v0/file/lookup?sha1=00000000000000c7e7fe703abc8f639e0ee507c4",
headers.clone(),
&router,
),