From 2be550c064a67bb557b3765108e2927f6a351ea7 Mon Sep 17 00:00:00 2001 From: kgriffs Date: Wed, 23 Jul 2014 17:09:06 -0500 Subject: [PATCH] Minor cleanup of utils unit test This patch removes an unnecessary stream seek from one test, and renames a couple other tests to reflect the refactoring of the filter_stream function into two separate functions. Change-Id: Ie6731766028dee2410193ae79ec4c6f985df1a92 --- tests/unit/queues/transport/wsgi/test_utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/unit/queues/transport/wsgi/test_utils.py b/tests/unit/queues/transport/wsgi/test_utils.py index 1aa38497c..d03ced41f 100644 --- a/tests/unit/queues/transport/wsgi/test_utils.py +++ b/tests/unit/queues/transport/wsgi/test_utils.py @@ -122,7 +122,6 @@ class TestUtils(testtools.TestCase): self.assertEqual(filtered, obj) # NOTE(kgriffs): Ensure default value for *spec* is None - doc_stream.seek(0) filtered2 = utils.sanitize(deserialized) self.assertEqual(filtered2, filtered) @@ -144,7 +143,7 @@ class TestUtils(testtools.TestCase): self.assertEqual(filtered, doc) - def test_filter_stream_expect_obj(self): + def test_deserialize_and_sanitize_json_obj(self): obj = {u'body': {'event': 'start_backup'}, 'id': 'DEADBEEF'} document = six.text_type(json.dumps(obj, ensure_ascii=False)) @@ -161,7 +160,7 @@ class TestUtils(testtools.TestCase): utils.sanitize, deserialized_object, spec, doctype=utils.JSONArray) - def test_filter_stream_expect_array(self): + def test_deserialize_and_sanitize_json_array(self): array = [{u'body': {u'x': 1}}, {u'body': {u'x': 2}}] document = six.text_type(json.dumps(array, ensure_ascii=False))