Browse Source

[raz] Skeleton of Python Raz Client tests

Romain Rigaux 4 years ago
parent
commit
9a56f9d564

+ 1 - 1
desktop/core/src/desktop/lib/raz/clients.py

@@ -36,7 +36,7 @@ class S3RazClient():
 
     self.ranger = RangerRazS3(RAZ.API_URL.get(), auth)
 
-  def get_url(self, bucket, path, perm='read'):
+  def get_url(self, bucket=None, path=None, perm='read'):
     # No GET/POST spec?
     # e.g. get_url('<storage_account?>', '<bucket>', '<relative_path>', 'read')
     return self.ranger.get_dsas_token(bucket, path, perm)

+ 3 - 0
desktop/core/src/desktop/lib/raz/clients_test.py

@@ -34,6 +34,8 @@ class S3RazClientLiveTest(unittest.TestCase):
 
     url = S3RazClient().get_url()
 
+    assert_true('AWSAccessKeyId=' in url)
+    assert_true('Signature=' in url)
     assert_true('Expires=' in url)
 
 
@@ -54,4 +56,5 @@ class S3RazClientLiveTest(unittest.TestCase):
     assert_true('Signature=' in url)
     assert_true('Expires=' in url)
 
+
   def test_check_acccess_s3_list_file_no_access(self): pass