mirror of
https://codeberg.org/Toasterson/ips.git
synced 2026-04-10 13:20:42 +00:00
Refactor tests and stubs: update parsed_manifest assertions with more descriptive values and simplify unused variable patterns in repository rest backend methods.
This commit is contained in:
parent
3ea955fc5f
commit
b451099b54
2 changed files with 8 additions and 8 deletions
|
|
@ -263,12 +263,12 @@ impl ReadableRepository for RestBackend {
|
|||
fn list_packages(
|
||||
&self,
|
||||
publisher: Option<&str>,
|
||||
pattern: Option<&str>,
|
||||
_pattern: Option<&str>,
|
||||
) -> Result<Vec<PackageInfo>> {
|
||||
// This is a stub implementation
|
||||
// In a real implementation, we would make a REST API call to list packages
|
||||
|
||||
let mut packages = Vec::new();
|
||||
let packages = Vec::new();
|
||||
|
||||
// Filter publishers if specified
|
||||
let publishers = if let Some(pub_name) = publisher {
|
||||
|
|
@ -281,7 +281,7 @@ impl ReadableRepository for RestBackend {
|
|||
};
|
||||
|
||||
// For each publisher, list packages
|
||||
for pub_name in publishers {
|
||||
for _pub_name in publishers {
|
||||
// In a real implementation, we would make a REST API call to get package information
|
||||
// The API call would return a list of packages with their names, versions, and other metadata
|
||||
// We would then parse this information and create PackageInfo structs
|
||||
|
|
@ -400,9 +400,9 @@ impl ReadableRepository for RestBackend {
|
|||
|
||||
fn search(
|
||||
&self,
|
||||
query: &str,
|
||||
publisher: Option<&str>,
|
||||
limit: Option<usize>,
|
||||
_query: &str,
|
||||
_publisher: Option<&str>,
|
||||
_limit: Option<usize>,
|
||||
) -> Result<Vec<PackageInfo>> {
|
||||
todo!()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ mod tests {
|
|||
|
||||
// Verify that the parsed manifest has the expected attributes
|
||||
assert_eq!(parsed_manifest.attributes.len(), 1);
|
||||
assert_eq!(parsed_manifest.attributes[0].key, "name");
|
||||
assert_eq!(parsed_manifest.attributes[0].values[0], "pkg.fmri");
|
||||
assert_eq!(parsed_manifest.attributes[0].key, "pkg.fmri");
|
||||
assert_eq!(parsed_manifest.attributes[0].values[0], "pkg://test/example@1.0.0");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue