Exemplo n.º 1
0
 def test_flatten_from_file(self):
     target = {"target": {"secret": {"project_id": "1234"}}}
     self.create_config_file("target.json", jsonutils.dumps(target))
     with open(self.get_config_file_fullname('target.json'), 'r') as fh:
         target_from_file = fh.read()
     result = shell.flatten(jsonutils.loads(target_from_file))
     self.assertEqual(result, {"target.secret.project_id": "1234"})
Exemplo n.º 2
0
 def test_flatten_from_dict(self):
     target = {
         "target": {
             "secret": {
                 "project_id": "1234"
             }
         }
     }
     result = shell.flatten(target)
     self.assertEqual(result, {"target.secret.project_id": "1234"})