From 4381355dccd7e9d3bd1289f68e1fe878c821bb7e Mon Sep 17 00:00:00 2001 From: Jordan Laser Date: Tue, 29 Oct 2024 14:53:29 -0600 Subject: [PATCH] fix test --- forcingprocessor/tests/test_forcingprocessor.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/forcingprocessor/tests/test_forcingprocessor.py b/forcingprocessor/tests/test_forcingprocessor.py index cf50efce..43d7803b 100644 --- a/forcingprocessor/tests/test_forcingprocessor.py +++ b/forcingprocessor/tests/test_forcingprocessor.py @@ -1,7 +1,6 @@ import os from pathlib import Path -from datetime import datetime -from datetime import timezone +from datetime import datetime, timedelta, timezone from forcingprocessor.processor import prep_ngen_data from forcingprocessor.nwm_filenames_generator import generate_nwmfiles import pytest @@ -10,6 +9,8 @@ date = datetime.now(timezone.utc) date = date.strftime('%Y%m%d') hourminute = '0000' +yesterday = datetime.now(timezone.utc) - timedelta(hours=24) +yesterday = yesterday.strftime('%Y%m%d') test_dir = Path(__file__).parent data_dir = (test_dir/'data').resolve() forcings_dir = (data_dir/'forcings').resolve() @@ -172,8 +173,8 @@ def test_noaa_nwm_pds_https_analysis_assim(): os.remove(assert_file) def test_noaa_nwm_pds_https_analysis_assim_extend(): - nwmurl_conf['start_date'] = date + hourminute - nwmurl_conf['end_date'] = date + hourminute + nwmurl_conf['start_date'] = yesterday + hourminute + nwmurl_conf['end_date'] = yesterday + hourminute nwmurl_conf["urlbaseinput"] = 7 nwmurl_conf["runinput"] = 6 nwmurl_conf["fcst_cycle"] = [16]