Merge "Nits from Ic3ab7d60e4ac12b767fe70bef97b327545a86e74"
This commit is contained in:
commit
ac8a3089e5
@ -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)
|
||||
|
@ -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/')
|
||||
|
Loading…
x
Reference in New Issue
Block a user