-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c2c140
commit 7779927
Showing
9 changed files
with
64 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,7 @@ impl<'de> Deserialize<'de> for Purl { | |
|
||
struct PurlVisitor; | ||
|
||
impl<'de> Visitor<'de> for PurlVisitor { | ||
impl Visitor<'_> for PurlVisitor { | ||
type Value = Purl; | ||
|
||
fn expecting(&self, formatter: &mut Formatter) -> std::fmt::Result { | ||
|
@@ -241,10 +241,8 @@ mod tests { | |
let purl: Purl = "pkg:maven/io.quarkus/[email protected]?foo=bar".try_into()?; | ||
let json = serde_json::to_string(&purl).unwrap(); | ||
|
||
Ok(assert_eq!( | ||
json, | ||
r#""pkg:maven/io.quarkus/[email protected]?foo=bar""# | ||
)) | ||
assert_eq!(json, r#""pkg:maven/io.quarkus/[email protected]?foo=bar""#); | ||
Ok(()) | ||
} | ||
|
||
#[test(tokio::test)] | ||
|
@@ -277,10 +275,11 @@ mod tests { | |
let purl: Purl = "pkg:oci/ose-cluster-network-operator@sha256:0170ba5eebd557fd9f477d915bb7e0d4c1ad6cd4c1852d4b1ceed7a2817dd5d2?repository_url=registry.redhat.io/openshift4/ose-cluster-network-operator&tag=v4.11.0-202403090037.p0.g33da9fb.assembly.stream.el8".try_into()?; | ||
let json = serde_json::to_string(&purl).unwrap(); | ||
|
||
Ok(assert_eq!( | ||
assert_eq!( | ||
json, | ||
r#""pkg:oci/ose-cluster-network-operator@sha256:0170ba5eebd557fd9f477d915bb7e0d4c1ad6cd4c1852d4b1ceed7a2817dd5d2?repository_url=registry.redhat.io/openshift4/ose-cluster-network-operator&tag=v4.11.0-202403090037.p0.g33da9fb.assembly.stream.el8""# | ||
)) | ||
); | ||
Ok(()) | ||
} | ||
|
||
#[test(tokio::test)] | ||
|
@@ -300,10 +299,11 @@ mod tests { | |
let purl: Purl = "pkg:rpm/redhat/[email protected]?arch=aarch64".try_into()?; | ||
let json = serde_json::to_string(&purl).unwrap(); | ||
|
||
Ok(assert_eq!( | ||
assert_eq!( | ||
json, | ||
r#""pkg:rpm/redhat/[email protected]?arch=aarch64""# | ||
)) | ||
); | ||
Ok(()) | ||
} | ||
|
||
#[test(tokio::test)] | ||
|
@@ -333,10 +333,11 @@ mod tests { | |
.try_into()?; | ||
let json = serde_json::to_string(&purl).unwrap(); | ||
|
||
Ok(assert_eq!( | ||
assert_eq!( | ||
json, | ||
r#""pkg:rpm/redhat/[email protected]_6?arch=s390x""# | ||
)) | ||
); | ||
Ok(()) | ||
} | ||
|
||
#[test(tokio::test)] | ||
|
@@ -353,6 +354,7 @@ mod tests { | |
"#, | ||
) | ||
.unwrap(); | ||
Ok(assert_eq!(purl1, purl2)) | ||
assert_eq!(purl1, purl2); | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,7 +205,9 @@ mod test { | |
response["items"][0]["ancestors"][0]["purl"], | ||
"pkg:rpm/redhat/[email protected]?arch=src" | ||
); | ||
Ok(assert_eq!(&response["total"], 1)) | ||
|
||
assert_eq!(&response["total"], 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -227,7 +229,8 @@ mod test { | |
response["items"][0]["ancestors"][0]["purl"], | ||
"pkg:rpm/redhat/[email protected]?arch=src" | ||
); | ||
Ok(assert_eq!(&response["total"], 1)) | ||
assert_eq!(&response["total"], 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -249,7 +252,8 @@ mod test { | |
response["items"][0]["ancestors"][0]["purl"], | ||
"pkg:rpm/redhat/[email protected]?arch=src" | ||
); | ||
Ok(assert_eq!(&response["total"], 1)) | ||
assert_eq!(&response["total"], 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -283,7 +287,8 @@ mod test { | |
"pkg:maven/com.redhat.quarkus.platform/[email protected]?type=pom&repository_url=https://maven.repository.redhat.com/ga/" | ||
); | ||
|
||
Ok(assert_eq!(&response["total"], 2)) | ||
assert_eq!(&response["total"], 2); | ||
Ok(()) | ||
} | ||
|
||
// TODO: this test passes when run individually. | ||
|
@@ -342,7 +347,8 @@ mod test { | |
"pkg:rpm/redhat/[email protected]" | ||
); | ||
|
||
Ok(assert_eq!(&response["total"], 3)) | ||
assert_eq!(&response["total"], 3); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -369,7 +375,8 @@ mod test { | |
"pkg:rpm/redhat/[email protected]" | ||
); | ||
|
||
Ok(assert_eq!(&response["total"], 1)) | ||
assert_eq!(&response["total"], 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -391,7 +398,8 @@ mod test { | |
response["items"][0]["deps"][0]["purl"], | ||
"pkg:rpm/redhat/[email protected]" | ||
); | ||
Ok(assert_eq!(&response["total"], 1)) | ||
assert_eq!(&response["total"], 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -414,7 +422,8 @@ mod test { | |
response["items"][0]["purl"], | ||
"pkg:maven/net.spy/[email protected]?type=jar" | ||
); | ||
Ok(assert_eq!(&response["total"], 2)) | ||
assert_eq!(&response["total"], 2); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -464,6 +473,7 @@ mod test { | |
let request: Request = TestRequest::get().uri(uri).to_request(); | ||
let response: Value = app.call_and_read_body_json(request).await; | ||
|
||
Ok(assert_eq!(&response["total"], 0)) | ||
assert_eq!(&response["total"], 0); | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -960,7 +960,8 @@ mod test { | |
.retrieve_root_components(Query::q("EE"), Paginated::default(), &ctx.db) | ||
.await | ||
.unwrap(); | ||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1005,7 +1006,8 @@ mod test { | |
.retrieve_root_components(Query::q("EE"), Paginated::default(), &ctx.db) | ||
.await | ||
.unwrap(); | ||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1044,7 +1046,8 @@ mod test { | |
.node_id, | ||
"SPDXRef-A".to_string() | ||
); | ||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1085,7 +1088,8 @@ mod test { | |
.node_id, | ||
"SPDXRef-A".to_string() | ||
); | ||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1119,7 +1123,8 @@ mod test { | |
"SPDXRef-e24fec28-1001-499c-827f-2e2e5f2671b5".to_string() | ||
); | ||
|
||
Ok(assert_eq!(analysis_graph.total, 2)) | ||
assert_eq!(analysis_graph.total, 2); | ||
Ok(()) | ||
} | ||
|
||
// TODO: this test passes when run individually. | ||
|
@@ -1171,7 +1176,8 @@ mod test { | |
.retrieve_root_components(Query::q("EE"), Paginated::default(), &ctx.db) | ||
.await | ||
.unwrap(); | ||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1195,7 +1201,8 @@ mod test { | |
.retrieve_root_components(Query::q("EE"), Paginated::default(), &ctx.db) | ||
.await | ||
.unwrap(); | ||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1214,7 +1221,8 @@ mod test { | |
analysis_graph.items[0].purl, | ||
"pkg:rpm/redhat/[email protected]?arch=src".to_string() | ||
); | ||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1237,7 +1245,8 @@ mod test { | |
"pkg:rpm/redhat/[email protected]?arch=src".to_string() | ||
); | ||
|
||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1256,7 +1265,8 @@ mod test { | |
.await | ||
.unwrap(); | ||
|
||
Ok(assert_eq!(analysis_graph.total, 2)) | ||
assert_eq!(analysis_graph.total, 2); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1274,7 +1284,8 @@ mod test { | |
.await | ||
.unwrap(); | ||
|
||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
@@ -1289,7 +1300,8 @@ mod test { | |
.await | ||
.unwrap(); | ||
|
||
Ok(assert_eq!(analysis_graph.total, 1)) | ||
assert_eq!(analysis_graph.total, 1); | ||
Ok(()) | ||
} | ||
|
||
#[test_context(TrustifyContext)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[toolchain] | ||
channel = "1.82.0" | ||
channel = "1.83.0" | ||
components = [ "rustfmt", "clippy" ] |