'Tests dumping ACPI table.'

def testDumpValidACPITableOk(self):

    client_mock = DumpACPITableMock()
    table_signature_list = ['DSDT', 'XSDT', 'SSDT']
    for _ in flow_test_lib.TestFlowHelper(hardware.DumpACPITable.__name__, client_mock, table_signature_list=table_signature_list, client_id=self.client_id, token=self.token):
        pass
    fd = aff4_hardware.ACPITableDataCollection(self.client_id.Add('/devices/chipsec/acpi/tables/DSDT'), token=self.token)
    self.assertEqual(len(fd), 1)
    self.assertEqual(fd[0], DumpACPITableMock.ACPI_TABLES['DSDT'][0])
    fd = aff4_hardware.ACPITableDataCollection(self.client_id.Add('/devices/chipsec/acpi/tables/XSDT'), token=self.token)
    self.assertEqual(len(fd), 1)
    self.assertEqual(fd[0], DumpACPITableMock.ACPI_TABLES['XSDT'][0])
    fd = aff4_hardware.ACPITableDataCollection(self.client_id.Add('/devices/chipsec/acpi/tables/SSDT'), token=self.token)
    self.assertEqual(len(fd), 2)
    self.assertEqual(fd[0], DumpACPITableMock.ACPI_TABLES['SSDT'][0])
    self.assertEqual(fd[1], DumpACPITableMock.ACPI_TABLES['SSDT'][1])
