'Test that the GetFile flow works.'

def testGetFile(self):

    client_mock = action_mocks.GetFileClientMock()
    pathspec = rdf_paths.PathSpec(pathtype=rdf_paths.PathSpec.PathType.OS, path=os.path.join(self.base_path, 'test_img.dd'))
    for _ in flow_test_lib.TestFlowHelper(transfer.GetFile.__name__, client_mock, token=self.token, client_id=self.client_id, pathspec=pathspec):
        pass
    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)
