Esempio n. 1
0
    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")
Esempio n. 2
0
    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"
            )
Esempio n. 3
0
 def test_is_empty(self):
     assert ActionUtility.is_empty("")
     assert ActionUtility.is_empty("  ")
     assert ActionUtility.is_empty(None)
     assert not ActionUtility.is_empty("None")