Skip to content

Commit 29bdb8b

Browse files
committed
Add good keyword test
1 parent 34294e0 commit 29bdb8b

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[
2+
{
3+
"request": {
4+
"uri": "http://alexcrichton-test.s3.amazonaws.com/crates/foo_good_key/foo_good_key-1.0.0.crate",
5+
"method": "PUT",
6+
"headers": [
7+
[
8+
"accept",
9+
"*/*"
10+
],
11+
[
12+
"accept-encoding",
13+
"gzip"
14+
],
15+
[
16+
"content-length",
17+
"35"
18+
],
19+
[
20+
"content-type",
21+
"application/gzip"
22+
]
23+
],
24+
"body": "H4sIAAAAAAAA/+3AAQEAAACCIP+vbkhQwKsBLq+17wAEAAA="
25+
},
26+
"response": {
27+
"status": 200,
28+
"headers": [],
29+
"body": ""
30+
}
31+
},
32+
{
33+
"request": {
34+
"uri": "http://alexcrichton-test.s3.amazonaws.com/fo/o_/foo_good_key",
35+
"method": "PUT",
36+
"headers": [
37+
[
38+
"accept",
39+
"*/*"
40+
],
41+
[
42+
"accept-encoding",
43+
"gzip"
44+
],
45+
[
46+
"content-length",
47+
"166"
48+
],
49+
[
50+
"content-type",
51+
"text/plain"
52+
]
53+
],
54+
"body": "eyJuYW1lIjoiZm9vX2dvb2Rfa2V5IiwidmVycyI6IjEuMC4wIiwiZGVwcyI6W10sImNrc3VtIjoiYWNiNTYwNGIxMjZhYzg5NGMxZWIxMWM0NTc1YmYyMDcyZmVhNjEyMzJhODg4ZTQ1Mzc3MGM3OWQ3ZWQ1NjQxOSIsImZlYXR1cmVzIjp7fSwieWFua2VkIjpmYWxzZSwibGlua3MiOm51bGx9Cg=="
55+
},
56+
"response": {
57+
"status": 200,
58+
"headers": [],
59+
"body": ""
60+
}
61+
}
62+
]

src/tests/krate/publish.rs

+12
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,18 @@ fn publish_after_removing_documentation() {
710710
assert_eq!(json.krate.documentation, None);
711711
}
712712

713+
#[test]
714+
fn good_keywords() {
715+
let (_, _, _, token) = TestApp::full().with_token();
716+
let crate_to_publish = PublishBuilder::new("foo_good_key")
717+
.keyword("c++")
718+
.keyword("crates-io_index")
719+
.keyword("1password");
720+
let json = token.publish_crate(crate_to_publish).good();
721+
assert_eq!(json.krate.name, "foo_good_key");
722+
assert_eq!(json.krate.max_version, "1.0.0");
723+
}
724+
713725
#[test]
714726
fn bad_keywords() {
715727
let (_, _, _, token) = TestApp::full().with_token();

0 commit comments

Comments
 (0)