Skip to content

Commit 19e1c14

Browse files
Merge #1566
1566: Migrate badge tests r=jtgeibel a=jtgeibel This migrates the badge tests and includes a few other minor test cleanups. Co-authored-by: Justin Geibel <[email protected]>
2 parents 83eedfc + 2bdac55 commit 19e1c14

File tree

5 files changed

+142
-128
lines changed

5 files changed

+142
-128
lines changed

src/tests/all.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use util::{Bad, RequestHelper, TestApp};
4444
use models::{Crate, CrateOwner, Dependency, Team, User, Version};
4545
use models::{NewCategory, NewTeam, NewUser};
4646
use schema::*;
47-
use views::krate_publish as u;
4847
use views::{EncodableCrate, EncodableKeyword, EncodableOwner, EncodableVersion, GoodCrate};
4948

5049
macro_rules! t {
@@ -292,27 +291,3 @@ fn new_category<'a>(category: &'a str, slug: &'a str, description: &'a str) -> N
292291
fn logout(req: &mut Request) {
293292
req.mut_extensions().pop::<User>();
294293
}
295-
296-
fn new_crate_to_body_with_tarball(new_crate: &u::EncodableCrateUpload, tarball: &[u8]) -> Vec<u8> {
297-
let json = serde_json::to_string(&new_crate).unwrap();
298-
let mut body = Vec::new();
299-
body.extend(
300-
[
301-
json.len() as u8,
302-
(json.len() >> 8) as u8,
303-
(json.len() >> 16) as u8,
304-
(json.len() >> 24) as u8,
305-
]
306-
.iter()
307-
.cloned(),
308-
);
309-
body.extend(json.as_bytes().iter().cloned());
310-
body.extend(&[
311-
tarball.len() as u8,
312-
(tarball.len() >> 8) as u8,
313-
(tarball.len() >> 16) as u8,
314-
(tarball.len() >> 24) as u8,
315-
]);
316-
body.extend(tarball);
317-
body
318-
}

0 commit comments

Comments
 (0)