def test_add_trigger_type(self):
        """
        This sensor has misconfigured trigger type. We shouldn't explode.
        """

        class FailTestSensor(object):
            started = False

            def setup(self):
                pass

            def start(self):
                FailTestSensor.started = True

            def stop(self):
                pass

            def get_trigger_types(self):
                return [{"description": "Ain't got no name"}]

        try:
            trigger_service.add_trigger_models(FailTestSensor().get_trigger_types())
            self.assertTrue(
                False, "Trigger type doesn't have 'name' field. Should have thrown."
            )
        except Exception:
            self.assertTrue(True)

        This sensor has misconfigured trigger type. We shouldn't explode.
        
st2common/tests/unit/test_trigger_services.py