1*33c0f93fSPavel Labathfrom lldbsuite.test.gdbclientutils import *
2*33c0f93fSPavel Labathfrom lldbsuite.test.lldbgdbclient import GDBPlatformClientTestBase
33cd8d7b1SGongyu Deng
4c240d2bbSMichał Górnyclass TestGDBRemoteDiskFileCompletion(GDBPlatformClientTestBase):
53cd8d7b1SGongyu Deng
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):
113cd8d7b1SGongyu Deng                return "M{},{}".format(
123cd8d7b1SGongyu Deng                    "test".encode().hex(),
133cd8d7b1SGongyu Deng                    "123".encode().hex()
143cd8d7b1SGongyu Deng                )
153cd8d7b1SGongyu Deng
163cd8d7b1SGongyu Deng        self.server.responder = Responder()
173cd8d7b1SGongyu Deng
183cd8d7b1SGongyu Deng        self.complete_from_to('platform get-size ', ['test', '123'])
193cd8d7b1SGongyu Deng        self.complete_from_to('platform get-file ', ['test', '123'])
203cd8d7b1SGongyu Deng        self.complete_from_to('platform put-file foo ', ['test', '123'])
213cd8d7b1SGongyu Deng        self.complete_from_to('platform file open ', ['test', '123'])
223cd8d7b1SGongyu Deng        self.complete_from_to('platform settings -w ', ['test', '123'])
23