chore: use a neutral application name and time zone in the download-name tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -330,14 +330,14 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn a_download_is_named_after_the_application_the_time_and_the_engine() {
|
fn a_download_is_named_after_the_application_the_time_and_the_engine() {
|
||||||
let name = download_name(
|
let name = download_name(
|
||||||
"lti",
|
"app",
|
||||||
taken(),
|
taken(),
|
||||||
Some("Asia/Jakarta"),
|
Some("Europe/Berlin"),
|
||||||
Some("postgres"),
|
Some("postgres"),
|
||||||
id(),
|
id(),
|
||||||
"dump",
|
"dump",
|
||||||
);
|
);
|
||||||
assert_eq!(name, "lti_2026-11-15T0230+0700_postgres_a1b2c3d4.dump");
|
assert_eq!(name, "app_2026-11-14T2030+0100_postgres_a1b2c3d4.dump");
|
||||||
let name = download_name("ledger", taken(), None, Some("mysql"), id(), "sql.gz");
|
let name = download_name("ledger", taken(), None, Some("mysql"), id(), "sql.gz");
|
||||||
assert_eq!(name, "ledger_2026-11-14T1930Z_mysql_a1b2c3d4.sql.gz");
|
assert_eq!(name, "ledger_2026-11-14T1930Z_mysql_a1b2c3d4.sql.gz");
|
||||||
// no engine (a folder snapshot): the part is left out
|
// no engine (a folder snapshot): the part is left out
|
||||||
@@ -350,7 +350,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn an_unknown_time_zone_falls_back_to_utc() {
|
fn an_unknown_time_zone_falls_back_to_utc() {
|
||||||
let name = download_name(
|
let name = download_name(
|
||||||
"lti",
|
"app",
|
||||||
taken(),
|
taken(),
|
||||||
Some("Mars/Olympus"),
|
Some("Mars/Olympus"),
|
||||||
Some("postgres"),
|
Some("postgres"),
|
||||||
@@ -363,8 +363,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn two_snapshots_in_the_same_minute_get_different_names() {
|
fn two_snapshots_in_the_same_minute_get_different_names() {
|
||||||
let other = Uuid::parse_str("ffffffff-0000-4000-8000-000000000000").unwrap();
|
let other = Uuid::parse_str("ffffffff-0000-4000-8000-000000000000").unwrap();
|
||||||
let a = download_name("lti", taken(), None, Some("postgres"), id(), "dump");
|
let a = download_name("app", taken(), None, Some("postgres"), id(), "dump");
|
||||||
let b = download_name("lti", taken(), None, Some("postgres"), other, "dump");
|
let b = download_name("app", taken(), None, Some("postgres"), other, "dump");
|
||||||
assert_ne!(a, b);
|
assert_ne!(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,11 +404,11 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn the_header_carries_both_filename_forms() {
|
fn the_header_carries_both_filename_forms() {
|
||||||
let header = content_disposition("lti_2026-11-15T0230+0700_postgres_a1b2c3d4.dump");
|
let header = content_disposition("app_2026-11-14T2030+0100_postgres_a1b2c3d4.dump");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
header,
|
header,
|
||||||
"attachment; filename=\"lti_2026-11-15T0230+0700_postgres_a1b2c3d4.dump\"; \
|
"attachment; filename=\"app_2026-11-14T2030+0100_postgres_a1b2c3d4.dump\"; \
|
||||||
filename*=UTF-8''lti_2026-11-15T0230%2B0700_postgres_a1b2c3d4.dump"
|
filename*=UTF-8''app_2026-11-14T2030%2B0100_postgres_a1b2c3d4.dump"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user