Skip to content

Commit

Permalink
Add test for Request::create_subresource
Browse files Browse the repository at this point in the history
Signed-off-by: pbzweihander <[email protected]>
  • Loading branch information
pbzweihander committed Aug 19, 2022
1 parent 080c923 commit c369efd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kube-core/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,17 @@ mod test {
assert_eq!(req.method(), "PUT");
}

#[test]
fn create_subresource_path() {
let url = corev1::ServiceAccount::url_path(&(), Some("ns"));
let pp = PostParams::default();
let data = vec![];
let req = Request::new(url)
.create_subresource("token", "sa", &pp, data)
.unwrap();
assert_eq!(req.uri(), "/api/v1/namespaces/ns/serviceaccounts/sa/token");
}

// TODO: reinstate if we get scoping in trait
//#[test]
//#[should_panic]
Expand Down

0 comments on commit c369efd

Please sign in to comment.