def test_send_message_add_stored_graph(self):
"""
C{send_message} send the graph with no data, to notify the server of
the existence of the script, even if the script hasn't been run yet.
"""
uid = os.getuid()
info = pwd.getpwuid(uid)
username = info.pw_name
self.manager.dispatch_message(
{"type": "custom-graph-add",
"interpreter": "/bin/sh",
"code": "echo hi!",
"username": username,
"graph-id": 123})
self.graph_manager.exchange()
self.assertMessages(
self.broker_service.message_store.get_pending_messages(),
[{"api": b"3.2",
"data": {123: {"error": u"",
"script-hash":
b"e00a2f44dbc7b6710ce32af2348aec9b",
"values": []}},
"timestamp": 0,
"type": "custom-graph"}])
评论列表
文章目录