xref: /llvm-project/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteDiskFileCompletion.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
133c0f93fSPavel Labathfrom lldbsuite.test.gdbclientutils import *
233c0f93fSPavel Labathfrom lldbsuite.test.lldbgdbclient import GDBPlatformClientTestBase
33cd8d7b1SGongyu Deng
43cd8d7b1SGongyu Deng
5*2238dcc3SJonas Devlieghereclass TestGDBRemoteDiskFileCompletion(GDBPlatformClientTestBase):
63cd8d7b1SGongyu Deng    def test_autocomplete_request(self):
73cd8d7b1SGongyu Deng        """Test remote disk completion on remote-gdb-server plugin"""
83cd8d7b1SGongyu Deng
93cd8d7b1SGongyu Deng        class Responder(MockGDBServerResponder):
103cd8d7b1SGongyu Deng            def qPathComplete(self):
11*2238dcc3SJonas Devlieghere                return "M{},{}".format("test".encode().hex(), "123".encode().hex())
123cd8d7b1SGongyu Deng
133cd8d7b1SGongyu Deng        self.server.responder = Responder()
143cd8d7b1SGongyu Deng
15*2238dcc3SJonas Devlieghere        self.complete_from_to("platform get-size ", ["test", "123"])
16*2238dcc3SJonas Devlieghere        self.complete_from_to("platform get-file ", ["test", "123"])
17*2238dcc3SJonas Devlieghere        self.complete_from_to("platform put-file foo ", ["test", "123"])
18*2238dcc3SJonas Devlieghere        self.complete_from_to("platform file open ", ["test", "123"])
19*2238dcc3SJonas Devlieghere        self.complete_from_to("platform settings -w ", ["test", "123"])
20