'Query WMI using WMI Query Language (WQL).'

def test_wmi_query(self):

    wmi_sampler = WMISampler('Win32_PerfFormattedData_PerfDisk_LogicalDisk', ['AvgDiskBytesPerWrite', 'FreeMegabytes'])
    wmi_sampler.sample()
    self.assertWMIQuery('Select    AvgDiskBytesPerWrite,FreeMegabytes    from    Win32_PerfFormattedData_PerfDisk_LogicalDisk')
    wmi_sampler = WMISampler('Win32_PerfFormattedData_PerfDisk_LogicalDisk', ['AvgDiskBytesPerWrite', 'FreeMegabytes'], filters=[{'Name': 'C:'}])
    wmi_sampler.sample()
    self.assertWMIQuery("Select    AvgDiskBytesPerWrite,FreeMegabytes    from    Win32_PerfFormattedData_PerfDisk_LogicalDisk    WHERE    (    Name    =    'C:'    )")
    wmi_sampler = WMISampler('Win32_PerfFormattedData_PerfDisk_LogicalDisk', ['AvgDiskBytesPerWrite', 'FreeMegabytes'], filters=[{'Name': 'C:', 'Id': '123'}])
    wmi_sampler.sample()
    self.assertWMIQuery("Select    AvgDiskBytesPerWrite,FreeMegabytes    from    Win32_PerfFormattedData_PerfDisk_LogicalDisk    WHERE    (    Name    =    'C:'    AND    Id    =    '123'    )")
