def test_select_index(self): with self.assertRaises(exceptions.IntrinsicFuncInputError) as ctx: functions.select(2, '', '') self.assertEqual(ctx.exception.message, functions.select._errmsg_index)
def test_select_null(self): with self.assertRaises(exceptions.IntrinsicFuncInputError) as ctx: functions.select(0, '', None) self.assertEqual(ctx.exception.message, functions.select._errmsg_null)
def test_select(self): ret = functions.select(3, 1, 2, 3, 4, 5) self.assertEqual(ret['Fn::Select'], [3, [1, 2, 3, 4, 5]])