'Test MultiGetFile.'

def testMultiGetFile(self):

    client_mock = action_mocks.MultiGetFileClientMock()
    pathspec = rdf_paths.PathSpec(pathtype=rdf_paths.PathSpec.PathType.OS, path=os.path.join(self.base_path, 'test_img.dd'))
    args = transfer.MultiGetFileArgs(pathspecs=[pathspec, pathspec])
    with test_lib.Instrument(transfer.MultiGetFile, 'StoreStat') as storestat_instrument:
        for _ in flow_test_lib.TestFlowHelper(transfer.MultiGetFile.__name__, client_mock, token=self.token, client_id=self.client_id, args=args):
            pass
        self.assertEqual(len(storestat_instrument.args), 1)
    pathspec.path = pathspec.path.replace('\\', '/')
    urn = pathspec.AFF4Path(self.client_id)
    fd1 = aff4.FACTORY.Open(urn, token=self.token)
    fd2 = open(pathspec.path, 'rb')
    fd2.seek(0, 2)
    self.assertEqual(fd2.tell(), int(fd1.Get(fd1.Schema.SIZE)))
    self.CompareFDs(fd1, fd2)
