[ARVADOS] updated: e7284afa8ccb95994dcd2009015cafc6180e7187

Git user git at public.curoverse.com
Wed Apr 19 15:30:16 EDT 2017


Summary of changes:
 sdk/python/arvados/commands/get.py |  2 +-
 sdk/python/tests/test_arv_get.py   | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

       via  e7284afa8ccb95994dcd2009015cafc6180e7187 (commit)
      from  67ba19113789346005aa61d4234bc33c8677a85c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e7284afa8ccb95994dcd2009015cafc6180e7187
Author: Lucas Di Pentima <lucas at curoverse.com>
Date:   Wed Apr 19 16:28:26 2017 -0300

    11502: Instead of asking for a stripped manifest, replace the tokens with some constant string to do the comparison.

diff --git a/sdk/python/arvados/commands/get.py b/sdk/python/arvados/commands/get.py
index e54fd87..3bf9295 100755
--- a/sdk/python/arvados/commands/get.py
+++ b/sdk/python/arvados/commands/get.py
@@ -87,7 +87,7 @@ skipped.
 """)
 group.add_argument('--strip-manifest', action='store_true', default=False,
                    help="""
-When getting a collection manifest, strip its access tokens before writing 
+When getting a collection manifest, strip its access tokens before writing
 it.
 """)
 
diff --git a/sdk/python/tests/test_arv_get.py b/sdk/python/tests/test_arv_get.py
index 8be528f..b7f5e2b 100644
--- a/sdk/python/tests/test_arv_get.py
+++ b/sdk/python/tests/test_arv_get.py
@@ -3,6 +3,7 @@
 
 import io
 import os
+import re
 import shutil
 import tempfile
 
@@ -78,20 +79,21 @@ class ArvadosGetTestCase(run_test_server.TestCaseWithServers):
             self.assertEqual("baz", f.read())
 
     def test_get_collection_unstripped_manifest(self):
+        dummy_token = "+Axxxxxxx"
         # Get the collection manifest by UUID
         r = self.run_get([self.col_loc, self.tempdir])
         self.assertEqual(0, r)
-        m_from_collection = collection.Collection(self.col_manifest).manifest_text(strip=True)
+        m_from_collection = re.sub(r"\+A[0-9a-f@]+", dummy_token, self.col_manifest)
         with open(os.path.join(self.tempdir, self.col_loc), "r") as f:
-            # Strip manifest before comparison to avoid races
-            m_from_file = collection.Collection(f.read()).manifest_text(strip=True)
+            # Replace manifest tokens before comparison to avoid races
+            m_from_file = re.sub(r"\+A[0-9a-f@]+", dummy_token, f.read())
             self.assertEqual(m_from_collection, m_from_file)
         # Get the collection manifest by PDH
         r = self.run_get([self.col_pdh, self.tempdir])
         self.assertEqual(0, r)
         with open(os.path.join(self.tempdir, self.col_pdh), "r") as f:
-            # Strip manifest before comparison to avoid races
-            m_from_file = collection.Collection(f.read()).manifest_text(strip=True)
+            # Replace manifest tokens before comparison to avoid races
+            m_from_file = re.sub(r"\+A[0-9a-f@]+", dummy_token, f.read())
             self.assertEqual(m_from_collection, m_from_file)
 
     def test_get_collection_stripped_manifest(self):

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list