From 6d8523a584958b3452510a9efb0704d5a57df957 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Tue, 28 Feb 2023 10:31:45 +0100
Subject: [PATCH] Use namespace to get result valule

---
 endpoint_tests/run_REFERENCEM.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/endpoint_tests/run_REFERENCEM.py b/endpoint_tests/run_REFERENCEM.py
index 4472432..2c52796 100755
--- a/endpoint_tests/run_REFERENCEM.py
+++ b/endpoint_tests/run_REFERENCEM.py
@@ -62,6 +62,8 @@ model_config = {
 # Posting the request to VIPSLogic
 r2 = requests.post("%s/models/%s/run" % (core_server_uri, model_id), json=model_config)
 #print r2.text
+# This script does not import VIPSCore-Python-Common. Thus, it does not have the 
+# util methods to parse the request, so we do it manually
 results = r2.json()
 for result in results:
     # Create a Python timestamp from the JSON timestamp string
@@ -69,10 +71,11 @@ for result in results:
     # Printing selected result parameters to stdout
     #print(result)
     allValues = json.loads(result["allValues"])
+
     print ("%s: Mean temp today = %s, Accumulated Day Degrees = %s, Warning status = %s" % (
         datetime.strftime(timestamp, '%Y-%m-%dT%H:%M %Z'),
         allValues.get("TM"),
-        allValues.get("TMDD"),
+        allValues.get("WEATHER.TMDD"),
         result["warningStatus"]
         )
     )
-- 
GitLab