Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-321-clearwater 1877d59c1 -> a9fb6fad4 (forced update)
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a9fb6fad/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py ---------------------------------------------------------------------- diff --git a/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py b/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py index 7ab1bdb..f7e7e6d 100644 --- a/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py +++ b/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py @@ -290,72 +290,72 @@ class TestCtxEntryPoint(object): class TestPathDictAccess(object): def test_simple_set(self): obj = {} - path_dict = ctx_proxy.server._PathDictAccess(obj) - path_dict.set('foo', 42) + path_access = ctx_proxy.server._PathAccess(obj) + path_access.set('foo', 42) assert obj == {'foo': 42} def test_nested_set(self): obj = {'foo': {}} - path_dict = ctx_proxy.server._PathDictAccess(obj) - path_dict.set('foo.bar', 42) + path_access = ctx_proxy.server._PathAccess(obj) + path_access.set('foo.bar', 42) assert obj == {'foo': {'bar': 42}} def test_set_index(self): obj = {'foo': [None, {'bar': 0}]} - path_dict = ctx_proxy.server._PathDictAccess(obj) - path_dict.set('foo[1].bar', 42) + path_access = ctx_proxy.server._PathAccess(obj) + path_access.set('foo[1].bar', 42) assert obj == {'foo': [None, {'bar': 42}]} def test_set_nonexistent_parent(self): obj = {} - path_dict = ctx_proxy.server._PathDictAccess(obj) - path_dict.set('foo.bar', 42) + path_access = ctx_proxy.server._PathAccess(obj) + path_access.set('foo.bar', 42) assert obj == {'foo': {'bar': 42}} def test_set_nonexistent_parent_nested(self): obj = {} - path_dict = ctx_proxy.server._PathDictAccess(obj) - path_dict.set('foo.bar.baz', 42) + path_access = ctx_proxy.server._PathAccess(obj) + path_access.set('foo.bar.baz', 42) assert obj == {'foo': {'bar': {'baz': 42}}} def test_simple_get(self): obj = {'foo': 42} - path_dict = ctx_proxy.server._PathDictAccess(obj) - result = path_dict.get('foo') + path_access = ctx_proxy.server._PathAccess(obj) + result = path_access.get('foo') assert result == 42 def test_nested_get(self): obj = {'foo': {'bar': 42}} - path_dict = ctx_proxy.server._PathDictAccess(obj) - result = path_dict.get('foo.bar') + path_access = ctx_proxy.server._PathAccess(obj) + result = path_access.get('foo.bar') assert result == 42 def test_nested_get_shadows_dotted_name(self): obj = {'foo': {'bar': 42}, 'foo.bar': 58} - path_dict = ctx_proxy.server._PathDictAccess(obj) - result = path_dict.get('foo.bar') + path_access = ctx_proxy.server._PathAccess(obj) + result = path_access.get('foo.bar') assert result == 42 def test_index_get(self): obj = {'foo': [0, 1]} - path_dict = ctx_proxy.server._PathDictAccess(obj) - result = path_dict.get('foo[1]') + path_access = ctx_proxy.server._PathAccess(obj) + result = path_access.get('foo[1]') assert result == 1 def test_get_nonexistent(self): obj = {} - path_dict = ctx_proxy.server._PathDictAccess(obj) + path_access = ctx_proxy.server._PathAccess(obj) with pytest.raises(RuntimeError): - path_dict.get('foo') + path_access.get('foo') def test_get_by_index_not_list(self): obj = {'foo': {0: 'not-list'}} - path_dict = ctx_proxy.server._PathDictAccess(obj) + path_access = ctx_proxy.server._PathAccess(obj) with pytest.raises(RuntimeError): - path_dict.get('foo[0]') + path_access.get('foo[0]') def test_get_by_index_nonexistent_parent(self): obj = {} - path_dict = ctx_proxy.server._PathDictAccess(obj) + path_access = ctx_proxy.server._PathAccess(obj) with pytest.raises(RuntimeError): - path_dict.get('foo[1]') + path_access.get('foo[1]')
