From 67a148feb9e2e5c69798dbd683a9bdf4fc71c95e Mon Sep 17 00:00:00 2001
From: Cresson Remi <remi.cresson@irstea.fr>
Date: Thu, 16 Jan 2025 16:07:11 +0100
Subject: [PATCH 1/2] Update file test_push.py

---
 tests/test_push.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/test_push.py b/tests/test_push.py
index d009e30..9c97f5d 100755
--- a/tests/test_push.py
+++ b/tests/test_push.py
@@ -7,8 +7,11 @@ local_filename = "/tmp/toto.txt"
 with open(local_filename, "w") as f:
     f.write("hello world")
 
-pushed = dinamis_sdk.push(
-    local_filename=local_filename,
-    target_url="https://s3-data.meso.umontpellier.fr/sm1-gdc-tests/titi.txt",
-)
+for i in range(2):
+    pushed = dinamis_sdk.push(
+        local_filename=local_filename,
+        target_url="https://s3-data.meso.umontpellier.fr/sm1-gdc-tests/titi.txt",
+    )
+    print(f"Push #{i} ok")
+
 print("Done")
-- 
GitLab


From 974346035e9e30b76e30abf6d62f1e76831dd3d8 Mon Sep 17 00:00:00 2001
From: Cresson Remi <remi.cresson@irstea.fr>
Date: Thu, 16 Jan 2025 16:18:17 +0100
Subject: [PATCH 2/2] Update file test_push.py

---
 tests/test_push.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/tests/test_push.py b/tests/test_push.py
index 9c97f5d..4aa2940 100755
--- a/tests/test_push.py
+++ b/tests/test_push.py
@@ -1,17 +1,24 @@
 #!/usr/bin/env python
 
 import dinamis_sdk
+import requests
 
 local_filename = "/tmp/toto.txt"
 
 with open(local_filename, "w") as f:
     f.write("hello world")
 
-for i in range(2):
-    pushed = dinamis_sdk.push(
-        local_filename=local_filename,
-        target_url="https://s3-data.meso.umontpellier.fr/sm1-gdc-tests/titi.txt",
-    )
-    print(f"Push #{i} ok")
+target_url = "https://s3-data.meso.umontpellier.fr/sm1-gdc-tests/titi.txt"
+
+dinamis_sdk.push(local_filename=local_filename, target_url=target_url)
+print("push OK")
+
+signed_url = dinamis_sdk.sign(target_url)
+print("sign OK")
+
+res = requests.get(signed_url, stream=True, timeout=10)
+assert res.status_code == 200, "Get NOK"
+print("get OK")
+
 
 print("Done")
-- 
GitLab