From 65809acef3790f262e42e843faba132eb47b9ec8 Mon Sep 17 00:00:00 2001 From: Bertrand Demiddelaer Date: Thu, 14 Apr 2022 17:07:56 +0200 Subject: [PATCH] RELENG-5710 test the version directive --- tests/end2end/test_simple.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/end2end/test_simple.py b/tests/end2end/test_simple.py index afd76ef..63fdc9b 100644 --- a/tests/end2end/test_simple.py +++ b/tests/end2end/test_simple.py @@ -125,6 +125,32 @@ def test_simple_upload_download(self): assert sha_download == sha_upload + def test_simple_upload_and_version(self): + + # Mimic an upload behind the ingress + url = '{artifacts_url}/upload/{container}/.final_status'.format( + artifacts_url=self.artifacts_url, + container=self.container + ) + success = 'SUCCESSFUL'.encode('utf-8') + upload = self.session.put(url, data=success) + assert upload.status_code == 200 + + # Mimic a version + url = '{artifacts_url}/version/42/{container}/.final_status'.format( + artifacts_url=self.artifacts_url, + container=self.container + ) + copy = self.session.get(url) + assert copy.status_code == 200 + + # Download the versioned object + get = self.session.get('{artifacts_url}/download/{container}/.ARTIFACTS_BEFORE/42/.final_status'.format( + artifacts_url=self.artifacts_url, + container=self.container + )) + assert get.status_code == 200 + def test_simple_upload_and_copy_behind_ingress(self): # Mimic an upload behind the ingress