def validate(self, clean=True): from kairon.action_server.actions import ActionUtility if ActionUtility.is_empty(self.key): raise ValidationError( "key in http action parameters cannot be empty") if self.parameter_type == "slot" and ActionUtility.is_empty( self.value): raise ValueError("Provide name of the slot as value")
def validate(self, clean=True): from kairon.action_server.actions import ActionUtility if self.parameter_type == "value" and ActionUtility.is_empty( self.value): raise ValidationError( "Either value for the key should be given or parameter_type should be set to slot" )
def test_is_empty(self): assert ActionUtility.is_empty("") assert ActionUtility.is_empty(" ") assert ActionUtility.is_empty(None) assert not ActionUtility.is_empty("None")