[ARVADOS] updated: 554300e76561021bd26f9143cdece13dd80341cd
git at public.curoverse.com
git at public.curoverse.com
Fri Jun 26 15:53:34 EDT 2015
Summary of changes:
sdk/python/arvados/commands/put.py | 5 +++--
sdk/python/tests/test_arv_put.py | 14 ++++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
via 554300e76561021bd26f9143cdece13dd80341cd (commit)
from 416a99c2039e879cefc67dd0764b8544ef6c2d53 (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 554300e76561021bd26f9143cdece13dd80341cd
Author: Brett Smith <brett at curoverse.com>
Date: Fri Jun 26 15:52:46 2015 -0400
Fix bad CollectionReader reference in arv-put.
No issue #.
diff --git a/sdk/python/arvados/commands/put.py b/sdk/python/arvados/commands/put.py
index d8ed90b..496db86 100644
--- a/sdk/python/arvados/commands/put.py
+++ b/sdk/python/arvados/commands/put.py
@@ -5,6 +5,7 @@
import argparse
import arvados
+import arvados.collection
import base64
import datetime
import errno
@@ -479,14 +480,14 @@ def main(arguments=None, stdout=sys.stdout, stderr=sys.stderr):
if args.stream:
output = writer.manifest_text()
if args.normalize:
- output = CollectionReader(output).manifest_text(normalize=True)
+ output = arvados.collection.CollectionReader(output).manifest_text(normalize=True)
elif args.raw:
output = ','.join(writer.data_locators())
else:
try:
manifest_text = writer.manifest_text()
if args.normalize:
- manifest_text = CollectionReader(manifest_text).manifest_text(normalize=True)
+ manifest_text = arvados.collection.CollectionReader(manifest_text).manifest_text(normalize=True)
replication_attr = 'replication_desired'
if api_client._schema.schemas['Collection']['properties'].get(replication_attr, None) is None:
# API called it 'redundancy' before #3410.
diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py
index d078268..d337023 100644
--- a/sdk/python/tests/test_arv_put.py
+++ b/sdk/python/tests/test_arv_put.py
@@ -381,6 +381,20 @@ class ArvadosPutTest(run_test_server.TestCaseWithServers, ArvadosBaseTestCase):
arv_put.ResumeCache.CACHE_DIR = orig_cachedir
os.chmod(cachedir, 0o700)
+ def test_normalize(self):
+ testfile1 = self.make_test_file()
+ testfile2 = self.make_test_file()
+ test_paths = [testfile1.name, testfile2.name]
+ # Reverse-sort the paths, so normalization must change their order.
+ test_paths.sort(reverse=True)
+ self.call_main_with_args(['--stream', '--no-progress', '--normalize'] +
+ test_paths)
+ manifest = self.main_stdout.getvalue()
+ # Assert the second file we specified appears first in the manifest.
+ file_indices = [manifest.find(':' + os.path.basename(path))
+ for path in test_paths]
+ self.assertGreater(*file_indices)
+
def test_error_name_without_collection(self):
self.assertRaises(SystemExit, self.call_main_with_args,
['--name', 'test without Collection',
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list