示例#1
0
 def test_object_get(self):
     value = {
         'key1': ['${gk_1_1}_test1', '${gk_1_2}_test2'],
         'key2': {
             'key2_1': '${gk_1_1}_${gk_1_2}_${key_not_exist}'
         }
     }
     sv = var.SpliceVariable(name='name', value=value, context=self.context)
     self.context.extract_output(self.act_1)
     test_value = {
         'key1': ['value_1_1_test1', 'value_1_2_test2'],
         'key2': {
             'key2_1': 'value_1_1_value_1_2_${key_not_exist}'
         }
     }
     self.assertEqual(sv.get(), test_value)
示例#2
0
 def test_get(self):
     sv = var.SpliceVariable(name='name',
                             value='${gk_1_1}_${gk_1_2}_${key_not_exist}',
                             context=self.context)
     self.context.extract_output(self.act_1)
     self.assertEqual(sv.get(), 'value_1_1_value_1_2_${key_not_exist}')