Skip to content

Commit d647c7b

Browse files
committed
fix build error
1 parent 1f12855 commit d647c7b

File tree

2 files changed

+6
-66
lines changed

2 files changed

+6
-66
lines changed

src/main.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ mod tests {
111111
StatusCode::UNAUTHORIZED,
112112
"test deploy if API_KEY is missing"
113113
);
114+
// set the API_KEY to right
115+
env::set_var("API_KEY", "right");
114116

115117
let req = test::TestRequest::get()
116118
.uri("/deploy")
@@ -122,7 +124,7 @@ mod tests {
122124
StatusCode::FORBIDDEN,
123125
"test deploy if API_KEY is wrong"
124126
);
125-
127+
126128
env::set_var("API_KEY", "right");
127129
let req = test::TestRequest::get()
128130
.uri("/deploy")
@@ -139,7 +141,7 @@ mod tests {
139141
body, "Missing url query parameter",
140142
"test body if url is missing"
141143
);
142-
144+
// test status if url is not end with .tar.gz
143145
let req = test::TestRequest::get()
144146
.uri("/deploy?url=https://example.com")
145147
.append_header(("X-Api-Key", "right"))
@@ -155,7 +157,7 @@ mod tests {
155157
body, "currently only .tar.gz files are supported",
156158
"test body if url is not end with .tar.gz"
157159
);
158-
160+
// test status if url is end with .tar.gz;
159161
let req = test::TestRequest::get()
160162
.uri("/deploy?url=https://example.com/test.tar.gz")
161163
.append_header(("X-Api-Key", "right"))
@@ -167,9 +169,6 @@ mod tests {
167169
"test status if url is end with .tar.gz"
168170
);
169171
let body = test::read_body(res).await;
170-
assert_eq!(
171-
body, "start deploy https://example.com/test.tar.gz\r\n",
172-
"test body if url is end with .tar.gz"
173-
);
172+
assert!(body.starts_with("start deploy https://example.com/test.tar.gz\r\n".as_bytes()));
174173
}
175174
}

src/util.rs

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)