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
This commit is contained in:
parent
38c28a2de8
commit
2be550c064
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user