Skip to content

Commit

Permalink
Expand test
Browse files Browse the repository at this point in the history
Signed-off-by: Mikail Bagishov <[email protected]>
  • Loading branch information
MikailBag committed Sep 6, 2022
1 parent 1012bdc commit a3d36ec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions kube-core/src/conversion/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,16 @@ impl From<ConversionResponse> for ConversionReview {

#[cfg(test)]
mod tests {
use super::ConversionReview;
use super::{ConversionRequest, ConversionResponse};

#[test]
fn simple_request_parses() {
// this file contains dump of real request generated by kubernetes v1.22
let data = include_str!("./test_data/simple.json");
// check that we can parse this request
let _: ConversionReview = serde_json::from_str(data).unwrap();
// check that we can parse this review, and all chain of conversion worls
let review = serde_json::from_str(data).unwrap();
let req = ConversionRequest::from_review(review).unwrap();
let res = ConversionResponse::for_request(req);
let _ = res.into_review();
}
}

0 comments on commit a3d36ec

Please sign in to comment.