'Format filters to a comprehensive WQL `WHERE` clause skipping empty lists.'

def test_wql_empty_list(self):

    from checks.libs.wmi import sampler
    format_filter = sampler.WMISampler._format_filter
    filters = []
    query = {}
    query['User'] = ('=', 'luser')
    query['SourceName'] = ('=', 'MSSQL')
    query['EventCode'] = []
    query['SomethingEmpty'] = []
    query['MoreNothing'] = []
    filters.append(query)
    self.assertEquals("    WHERE    (    SourceName    =    'MSSQL'    AND    User    =    'luser'    )", format_filter(filters))
