本文整理汇总了Python中pants.java.nailgun_protocol.NailgunProtocol.send_request方法的典型用法代码示例。如果您正苦于以下问题:Python NailgunProtocol.send_request方法的具体用法?Python NailgunProtocol.send_request怎么用?Python NailgunProtocol.send_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.java.nailgun_protocol.NailgunProtocol
的用法示例。
在下文中一共展示了NailgunProtocol.send_request方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_send_and_parse_request
# 需要导入模块: from pants.java.nailgun_protocol import NailgunProtocol [as 别名]
# 或者: from pants.java.nailgun_protocol.NailgunProtocol import send_request [as 别名]
def test_send_and_parse_request(self):
# Send a test request over the client socket.
NailgunProtocol.send_request(
self.client_sock,
self.TEST_WORKING_DIR,
self.TEST_COMMAND,
*self.TEST_ARGUMENTS,
**self.TEST_ENVIRON
)
# Receive the request from the server-side context.
working_dir, command, arguments, environment = NailgunProtocol.parse_request(self.server_sock)
self.assertEqual(working_dir, self.TEST_WORKING_DIR)
self.assertEqual(command, self.TEST_COMMAND)
self.assertEqual(arguments, self.TEST_ARGUMENTS)
self.assertEqual(environment, self.TEST_ENVIRON)
示例2: test_handle_request
# 需要导入模块: from pants.java.nailgun_protocol import NailgunProtocol [as 别名]
# 或者: from pants.java.nailgun_protocol.NailgunProtocol import send_request [as 别名]
def test_handle_request(self, mock_run_pants):
NailgunProtocol.send_request(self.client_sock, '/test', './pants', 'help-advanced')
self.handler.handle_request()
self.assertIs(mock_run_pants.called, True)