コード例 #1
0
 def test_multiple_key(self):
     self._dict["prefix"] = {"foo": {"bar": "baz"}}
     w = NamespacedDictWrapper(self._dict, ("prefix", "foo"))
     self.assertEqual(w["bar"], "baz")
コード例 #2
0
 def test_json_dumps_multiple_key(self):
     self._dict["prefix"] = {"foo": {"bar": "baz"}}
     w = NamespacedDictWrapper(self._dict, ("prefix", "foo"))
     self.assertEqual(salt.utils.json.dumps(w), '{"bar": "baz"}')
コード例 #3
0
 def test_single_key(self):
     self._dict["prefix"] = {"foo": "bar"}
     w = NamespacedDictWrapper(self._dict, "prefix")
     self.assertEqual(w["foo"], "bar")
コード例 #4
0
 def test_json_dumps_multiple_key(self):
     self._dict['prefix'] = {'foo': {'bar': 'baz'}}
     w = NamespacedDictWrapper(self._dict, ('prefix', 'foo'))
     self.assertEqual(salt.utils.json.dumps(w), '{"bar": "baz"}')
コード例 #5
0
 def test_json_dumps_single_key(self):
     self._dict['prefix'] = {'foo': {'bar': 'baz'}}
     w = NamespacedDictWrapper(self._dict, 'prefix')
     self.assertEqual(salt.utils.json.dumps(w), '{"foo": {"bar": "baz"}}')
コード例 #6
0
 def test_multiple_key(self):
     self._dict['prefix'] = {'foo': {'bar': 'baz'}}
     w = NamespacedDictWrapper(self._dict, ('prefix', 'foo'))
     self.assertEqual(w['bar'], 'baz')
コード例 #7
0
 def test_single_key(self):
     self._dict['prefix'] = {'foo': 'bar'}
     w = NamespacedDictWrapper(self._dict, 'prefix')
     self.assertEqual(w['foo'], 'bar')