mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 08:18:18 +00:00
refactor: narrow test harness compatibility surfaces (#3592)
This commit is contained in:
@@ -25,6 +25,7 @@ pub use bucket::{BucketInfo, BucketOperations, BucketOptions, DeleteBucketOption
|
||||
pub use error::{StorageErrorCode, StorageResult};
|
||||
pub use multipart::{CompletePart, ListMultipartsInfo, ListPartsInfo, MultipartInfo, MultipartUploadResult, PartInfo};
|
||||
pub use object::{DeletedObject, ObjectToDelete};
|
||||
pub use object::{ExpirationOptions, TransitionedObject};
|
||||
pub use object::{HTTPPreconditions, HTTPRangeError, HTTPRangeSpec, ObjectLockRetentionOptions};
|
||||
pub use object::{HealOperations, MultipartOperations, NamespaceLocking, ObjectIO, ObjectOperations};
|
||||
pub use object::{ListObjectVersionsInfo, ListObjectsInfo, ListObjectsV2Info, ListOperations, ObjectInfoOrErr};
|
||||
|
||||
@@ -48,6 +48,20 @@ pub struct ObjectLockRetentionOptions {
|
||||
pub bypass_governance: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct ExpirationOptions {
|
||||
pub expire: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct TransitionedObject {
|
||||
pub name: String,
|
||||
pub version_id: String,
|
||||
pub tier: String,
|
||||
pub free_version: bool,
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct ObjectPreconditionPart {
|
||||
pub number: usize,
|
||||
@@ -797,6 +811,19 @@ mod tests {
|
||||
assert_eq!(object.delete_marker_replication_status(), ReplicationStatusType::Empty);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lifecycle_helper_defaults_preserve_existing_contracts() {
|
||||
let expiration = ExpirationOptions::default();
|
||||
let transitioned = TransitionedObject::default();
|
||||
|
||||
assert!(!expiration.expire);
|
||||
assert!(transitioned.name.is_empty());
|
||||
assert!(transitioned.version_id.is_empty());
|
||||
assert!(transitioned.tier.is_empty());
|
||||
assert!(!transitioned.free_version);
|
||||
assert!(transitioned.status.is_empty());
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct TestListBackend;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user