[ARVADOS] updated: 3e157b65c2984537de1615c3fc8e41272d45ea69

git at public.curoverse.com git at public.curoverse.com
Wed Mar 11 14:00:37 EDT 2015


Summary of changes:
 sdk/python/arvados/arvfile.py   |  8 +++++---
 sdk/python/tests/test_stream.py | 14 ++++++++++++++
 2 files changed, 19 insertions(+), 3 deletions(-)

       via  3e157b65c2984537de1615c3fc8e41272d45ea69 (commit)
      from  83c0e051c3611b021d7f0e2ea58d10c67c92698d (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 3e157b65c2984537de1615c3fc8e41272d45ea69
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Mar 11 14:00:31 2015 -0400

    Add missing re import to PySDK arvfile module.
    
    No issue #.

diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py
index c820309..53ae4a8 100644
--- a/sdk/python/arvados/arvfile.py
+++ b/sdk/python/arvados/arvfile.py
@@ -2,17 +2,19 @@ import functools
 import os
 import zlib
 import bz2
-from ._ranges import locators_and_ranges, replace_range, Range
-from arvados.retry import retry_method
 import config
 import hashlib
 import threading
 import Queue
 import copy
 import errno
+import re
+
 from .errors import KeepWriteError, AssertionError
 from .keep import KeepLocator
-from _normalize_stream import normalize_stream
+from ._normalize_stream import normalize_stream
+from ._ranges import locators_and_ranges, replace_range, Range
+from .retry import retry_method
 
 def split(path):
     """split(path) -> streamname, filename
diff --git a/sdk/python/tests/test_stream.py b/sdk/python/tests/test_stream.py
index 5bf82cc..15257fe 100644
--- a/sdk/python/tests/test_stream.py
+++ b/sdk/python/tests/test_stream.py
@@ -146,6 +146,20 @@ class StreamFileReaderTestCase(unittest.TestCase):
         self.assertEqual('nametest', sfile.name)
         self.assertEqual('nametest', sfile.name())
 
+    def check_decompressed_name(self, filename, expect):
+        stream = tutil.MockStreamReader('.', '')
+        reader = StreamFileReader(stream, [Range(0, 0, 0)], filename)
+        self.assertEqual(expect, reader.decompressed_name())
+
+    def test_decompressed_name_uncompressed_file(self):
+        self.check_decompressed_name('test.log', 'test.log')
+
+    def test_decompressed_name_gzip_file(self):
+        self.check_decompressed_name('test.log.gz', 'test.log')
+
+    def test_decompressed_name_bz2_file(self):
+        self.check_decompressed_name('test.log.bz2', 'test.log')
+
     def check_decompression(self, compress_ext, compress_func):
         test_text = 'decompression\ntest\n'
         test_data = compress_func(test_text)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list