From 579ae3880c12aa42218649e628de5c25da55beb7 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Tue, 28 Nov 2017 15:55:45 +0100 Subject: [PATCH] Nits from Ic3ab7d60e4ac12b767fe70bef97b327545a86e74 A missing test case and a missing space in an error message are adde as a follow up of Ic3ab7d60e4ac12b767fe70bef97b327545a86e74 Change-Id: I9d348dc5ce74590a4bed7b7e746333e3df3848c7 --- nova/tests/json_ref.py | 2 +- nova/tests/unit/test_json_ref.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/nova/tests/json_ref.py b/nova/tests/json_ref.py index 8d6619910d0a..ce1399e7557f 100644 --- a/nova/tests/json_ref.py +++ b/nova/tests/json_ref.py @@ -20,7 +20,7 @@ from oslo_serialization import jsonutils def _resolve_ref(ref, base_path): file_path, _, json_path = ref.partition('#') if json_path: - raise NotImplementedError('JSON refs with JSON path after the "#" is' + raise NotImplementedError('JSON refs with JSON path after the "#" is ' 'not yet supported') path = os.path.join(base_path, file_path) diff --git a/nova/tests/unit/test_json_ref.py b/nova/tests/unit/test_json_ref.py index 1bcc860340e0..4ae172d8a4e6 100644 --- a/nova/tests/unit/test_json_ref.py +++ b/nova/tests/unit/test_json_ref.py @@ -132,3 +132,13 @@ class TestJsonRef(test.NoDBTestCase): 'c': 13}}}, actual) mock_open.assert_called_once_with('some/base/path/another.json', 'r+b') + + def test_ref_with_json_path_not_supported(self): + + self.assertRaises( + NotImplementedError, json_ref.resolve_refs, + {'foo': 1, + 'bar': {'$ref': 'another.json#/key-in-another', + 'boo': {'b': 3, + 'c': 13}}}, + 'some/base/path/')