

@mock.patch.object(sensor_type_utils, '_create_trigger_types', mock.MagicMock(return_value=['mock.trigger_ref']))
def test_to_sensor_db_model_with_trigger_types(self):
    sensor_meta = {
        'artifact_uri': 'file:///data/st2contrib/packs/jira/sensors/jira_sensor.py',
        'class_name': 'JIRASensor',
        'pack': 'jira',
        'trigger_types': [{
            'pack': 'jira',
            'name': 'issue_created',
            'parameters': {
                
            },
        }],
    }
    sensor_api = SensorTypeAPI(**sensor_api)
    sensor_model = SensorTypeAPI.to_model(sensor_api)
    self.assertListEqual(sensor_model.trigger_types, ['mock.trigger_ref'])

dataset/ETHPy150Open StackStorm/st2/st2common/tests/unit/test_sensor_type_utils.py SensorTypeUtilsTestCase.test_to_sensor_db_model_with_trigger_types/VarMisuse@86/173 `sensor_meta`->`sensor_api`