def METHOD_NAME(self):
    p = self.load_policy({'name': 'x', 'resource': 'ec2'})
    source = p.resource_manager.get_source('config')
    # if query passed in reflect it back
    self.assertEqual(
        source.get_query_params({'expr': 'select 1'}),
        {'expr': 'select 1'})
    # if no query passed reflect back policy data
    p.data['query'] = [{'expr': 'select configuration'}]
    self.assertEqual(
        source.get_query_params(None), {'expr': 'select configuration'})
    p.data.pop('query')
    # default query construction
    self.assertTrue(
        source.get_query_params(None)['expr'].startswith(
            'select resourceId, configuration, supplementaryConfiguration where resourceType'))
    p.data['query'] = [{'clause': "configuration.imageId = 'xyz'"}]
    self.assertIn("imageId = 'xyz'", source.get_query_params(None)['expr'])