Skip to content

Commit

Permalink
Use UNIX_EPOCH constant in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Chung Ma <alanchunggt@gmail.com>
  • Loading branch information
alanssitis committed May 16, 2024
1 parent 546dbd9 commit c720068
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/models/layout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ mod test {
fn parse_datetime_test() {
let time_str = "1970-01-01T00:00:00Z".to_string();
let parsed_dt = parse_datetime(&time_str[..]).unwrap();
let dt = DateTime::from_timestamp(0, 0).unwrap();
let dt = DateTime::UNIX_EPOCH;
assert_eq!(parsed_dt, dt);
}

#[test]
fn format_datetime_test() {
let dt = DateTime::from_timestamp(0, 0).unwrap();
let dt = DateTime::UNIX_EPOCH;
let generated_dt_str = format_datetime(&dt);
let dt_str = "1970-01-01T00:00:00Z".to_string();
assert_eq!(dt_str, generated_dt_str);
Expand All @@ -129,7 +129,7 @@ mod test {
)
.unwrap();
let metadata = LayoutMetadataBuilder::new()
.expires(DateTime::from_timestamp(0, 0).unwrap())
.expires(DateTime::UNIX_EPOCH)
.add_key(alice_key.clone())
.add_key(bob_key.clone())
.add_step(
Expand Down
2 changes: 1 addition & 1 deletion src/models/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ mod tests {
PrivateKey::from_ed25519(OWNER_PRIVATE_KEY).unwrap();
let layout_metadata = Box::new(
LayoutMetadataBuilder::new()
.expires(DateTime::from_timestamp(0, 0).unwrap())
.expires(DateTime::UNIX_EPOCH)
.add_key(alice_public_key.clone())
.add_key(bob_public_key.clone())
.add_step(
Expand Down

0 comments on commit c720068

Please sign in to comment.