From 2145ffc2a169704effbf47e082a6ed28766b2bfd Mon Sep 17 00:00:00 2001 From: AdamFinkle <77808710+AdamFinkle@users.noreply.github.com> Date: Tue, 24 Sep 2024 20:52:00 -0400 Subject: [PATCH] Changed test to use datetime. (#252) * Changed test to use datetime. * Changed variable name. --- heat-stack/app/utils/pyodide.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/heat-stack/app/utils/pyodide.test.ts b/heat-stack/app/utils/pyodide.test.ts index 1dff3364..16e7cd17 100644 --- a/heat-stack/app/utils/pyodide.test.ts +++ b/heat-stack/app/utils/pyodide.test.ts @@ -220,6 +220,7 @@ test('pyodide solves climate change', async () => { } const executePy = await pyodide.runPythonAsync(` + from datetime import date from rules_engine import parser from rules_engine.pydantic_models import ( FuelType, @@ -237,7 +238,7 @@ test('pyodide solves climate change', async () => { summaryInput = SummaryInput(**summaryInputFromJs) - temperatureInput = TemperatureInput(**temperatureInputFromJs) + temperatureInput = TemperatureInput(dates=[date.fromisoformat(date_) for date_ in temperatureInputFromJs["dates"]], temperatures=temperatureInputFromJs["temperatures"]) outputs = engine.get_outputs_natural_gas(summaryInput,temperatureInput, naturalGasInputRecords)