summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-08-12 13:26:51 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-08-12 13:26:51 +0200
commita58a312baf4408774584bbad5d170583f05e07a7 (patch)
tree339585aec1e9c96c2639fd39343bbd0afb1e747f /t
parent8ec002f0415665bb3a575d6c44b6fd7a1b8a1eb8 (diff)
fix tests (use relative datetimes for proper past visibility handling)
Diffstat (limited to 't')
-rw-r--r--t/23-journey-visibility.t8
-rw-r--r--t/24-past-visibility.t8
2 files changed, 8 insertions, 8 deletions
diff --git a/t/23-journey-visibility.t b/t/23-journey-visibility.t
index 023c026..0cff11c 100644
--- a/t/23-journey-visibility.t
+++ b/t/23-journey-visibility.t
@@ -274,14 +274,14 @@ is(
undef
);
-my $dep = DateTime->now;
-my $arr = $dep->clone->add( hours => 1 );
+my $dep = DateTime->now->subtract( hours => 2 );
+my $arr = DateTime->now->subtract( hours => 1 );
my $train_dep = Travel::Status::DE::IRIS::Result->new(
classes => 'N',
type => 'DPN',
train_no => '667',
raw_id => '1234-2306251312-1',
- departure_ts => '2306251312',
+ departure_ts => $dep->strftime('%y%m%d%H%M'),
platform => 8,
station => 'Aachen Hbf',
station_uic => 8000001,
@@ -292,7 +292,7 @@ my $train_arr = Travel::Status::DE::IRIS::Result->new(
type => 'DPN',
train_no => '667',
raw_id => '1234-2306251312-3',
- arrival_ts => '2306252000',
+ arrival_ts => $arr->strftime('%y%m%d%H%M'),
platform => 1,
station => 'Aalen Hbf',
station_uic => 8000002,
diff --git a/t/24-past-visibility.t b/t/24-past-visibility.t
index de46b9b..51c8081 100644
--- a/t/24-past-visibility.t
+++ b/t/24-past-visibility.t
@@ -237,14 +237,14 @@ is(
undef
);
-my $dep = DateTime->now;
-my $arr = $dep->clone->add( hours => 1 );
+my $dep = DateTime->now->subtract( hours => 2 );
+my $arr = DateTime->now->subtract( hours => 1 );
my $train_dep = Travel::Status::DE::IRIS::Result->new(
classes => 'N',
type => 'DPN',
train_no => '667',
raw_id => '1234-2306251312-1',
- departure_ts => '2306251312',
+ departure_ts => $dep->strftime('%y%m%d%H%M'),
platform => 8,
station => 'Aachen Hbf',
station_uic => 8000001,
@@ -255,7 +255,7 @@ my $train_arr = Travel::Status::DE::IRIS::Result->new(
type => 'DPN',
train_no => '667',
raw_id => '1234-2306251312-3',
- arrival_ts => '2306252000',
+ arrival_ts => $arr->strftime('%y%m%d%H%M'),
platform => 1,
station => 'Aalen Hbf',
station_uic => 8000002,