Skip to content

Commit

Permalink
data: add support for fedora 33 container updates (FedoraRelease::F33C)
Browse files Browse the repository at this point in the history
  • Loading branch information
decathorpe committed Mar 5, 2020
1 parent cec28b4 commit c25991e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ impl FromStr for ContentType {
#[non_exhaustive]
pub enum FedoraRelease {
F33,
F33C,
F32,
F32C,
F32M,
Expand Down Expand Up @@ -253,6 +254,7 @@ impl Display for FedoraRelease {
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
let value = match self {
FedoraRelease::F33 => "F33",
FedoraRelease::F33C => "F33C",
FedoraRelease::F32 => "F32",
FedoraRelease::F32C => "F32C",
FedoraRelease::F32M => "F32M",
Expand Down Expand Up @@ -296,6 +298,7 @@ impl TryFrom<&str> for FedoraRelease {
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"F33" => Ok(FedoraRelease::F33),
"F33C" => Ok(FedoraRelease::F33C),
"F32" => Ok(FedoraRelease::F32),
"F32C" => Ok(FedoraRelease::F32C),
"F32M" => Ok(FedoraRelease::F32M),
Expand Down
7 changes: 7 additions & 0 deletions tests/builds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::fs::read_to_string;
use bodhi::Build;

const JSON_F33: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/builds_f33.json");
const JSON_F33C: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/builds_f33c.json");
const JSON_F32: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/builds_f32.json");
const JSON_F32C: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/builds_f32c.json");
const JSON_F32M: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/builds_f32m.json");
Expand Down Expand Up @@ -44,6 +45,12 @@ fn builds_dejson_f33() {
let _: Vec<Build> = serde_json::from_str(&read_to_string(JSON_F33).unwrap()).unwrap();
}

#[cfg(feature = "data-tests")]
#[test]
fn builds_dejson_f33c() {
let _: Vec<Build> = serde_json::from_str(&read_to_string(JSON_F33C).unwrap()).unwrap();
}

#[cfg(feature = "data-tests")]
#[test]
fn builds_dejson_f32() {
Expand Down
2 changes: 2 additions & 0 deletions tests/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

ALL_RELEASES = [
"F33",
"F33C",
"F32",
"F32C",
"F32M",
Expand Down Expand Up @@ -46,6 +47,7 @@

ACTIVE_RELEASES = [
"F33",
"F33C",
"F32",
"F32C",
"F32M",
Expand Down
1 change: 1 addition & 0 deletions tests/generate_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

RELEASES = [
"F33",
"F33C",
"F32",
"F32C",
"F32M",
Expand Down
7 changes: 7 additions & 0 deletions tests/overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::fs::read_to_string;
use bodhi::Override;

const JSON_F33: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/overrides_f33.json");
const JSON_F33C: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/overrides_f33c.json");
const JSON_F32: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/overrides_f32.json");
const JSON_F32C: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/overrides_f32c.json");
const JSON_F32M: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/overrides_f32m.json");
Expand Down Expand Up @@ -44,6 +45,12 @@ fn overrides_dejson_f33() {
let _: Vec<Override> = serde_json::from_str(&read_to_string(JSON_F33).unwrap()).unwrap();
}

#[cfg(feature = "data-tests")]
#[test]
fn overrides_dejson_f33c() {
let _: Vec<Override> = serde_json::from_str(&read_to_string(JSON_F33C).unwrap()).unwrap();
}

#[cfg(feature = "data-tests")]
#[test]
fn overrides_dejson_f32() {
Expand Down
7 changes: 7 additions & 0 deletions tests/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::fs::read_to_string;
use bodhi::Update;

const JSON_F33: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/updates_f33.json");
const JSON_F33C: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/updates_f33c.json");
const JSON_F32: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/updates_f32.json");
const JSON_F32C: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/updates_f32c.json");
const JSON_F32M: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/updates_f32m.json");
Expand Down Expand Up @@ -44,6 +45,12 @@ fn updates_dejson_f33() {
let _: Vec<Update> = serde_json::from_str(&read_to_string(JSON_F33).unwrap()).unwrap();
}

#[cfg(feature = "data-tests")]
#[test]
fn updates_dejson_f33c() {
let _: Vec<Update> = serde_json::from_str(&read_to_string(JSON_F33C).unwrap()).unwrap();
}

#[cfg(feature = "data-tests")]
#[test]
fn updates_dejson_f32() {
Expand Down

0 comments on commit c25991e

Please sign in to comment.