From 5c272f4d1c4ae67a3cf5a6af17518c82f520c1de Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Mon, 22 Oct 2012 13:59:31 -0400 Subject: Minor refactorings to mark an internal routine Just a couple of changes to mark a routine as internal to this module (leading underscore, helps understand what is part of the utils API and what is not), and use of the positional argument for memcache for consistency and reduction in line count (doing this ahead of another refactoring to keep changes concise). Change-Id: I71581ad6ac4c383b1de787b767be568fc0a87eef Signed-off-by: Peter Portante Reviewed-on: http://review.gluster.org/4138 Reviewed-by: Kaleb KEITHLEY Reviewed-by: Mohammed Junaid Tested-by: Gluster Build System --- swift/1.4.8/test/unit/plugins/test_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'swift/1.4.8/test/unit') diff --git a/swift/1.4.8/test/unit/plugins/test_utils.py b/swift/1.4.8/test/unit/plugins/test_utils.py index 70081a7d26e..0731c78656b 100644 --- a/swift/1.4.8/test/unit/plugins/test_utils.py +++ b/swift/1.4.8/test/unit/plugins/test_utils.py @@ -291,14 +291,14 @@ class TestUtils(unittest.TestCase): def test_get_etag_empty(self): tf = tempfile.NamedTemporaryFile() - hd = utils.get_etag(tf.name) + hd = utils._get_etag(tf.name) assert hd == hashlib.md5().hexdigest() def test_get_etag(self): tf = tempfile.NamedTemporaryFile() tf.file.write('123' * utils.CHUNK_SIZE) tf.file.flush() - hd = utils.get_etag(tf.name) + hd = utils._get_etag(tf.name) tf.file.seek(0) md5 = hashlib.md5() while True: @@ -335,7 +335,7 @@ class TestUtils(unittest.TestCase): assert md[utils.X_CONTENT_TYPE] == utils.FILE_TYPE assert md[utils.X_CONTENT_LENGTH] == os.path.getsize(tf.name) assert md[utils.X_TIMESTAMP] == normalize_timestamp(os.path.getctime(tf.name)) - assert md[utils.X_ETAG] == utils.get_etag(tf.name) + assert md[utils.X_ETAG] == utils._get_etag(tf.name) def test_get_object_metadata_dir(self): td = tempfile.mkdtemp() @@ -372,7 +372,7 @@ class TestUtils(unittest.TestCase): assert md[utils.X_CONTENT_TYPE] == utils.FILE_TYPE assert md[utils.X_CONTENT_LENGTH] == os.path.getsize(tf.name) assert md[utils.X_TIMESTAMP] == normalize_timestamp(os.path.getctime(tf.name)) - assert md[utils.X_ETAG] == utils.get_etag(tf.name) + assert md[utils.X_ETAG] == utils._get_etag(tf.name) def test_create_object_metadata_dir(self): td = tempfile.mkdtemp() -- cgit