grpc: removed add hook and get gooks, can be achieved with get session and start session
This commit is contained in:
parent
634341dd03
commit
f271b0289e
6 changed files with 0 additions and 184 deletions
|
@ -351,41 +351,6 @@ class TestGrpc:
|
|||
# then
|
||||
assert response.terminal is not None
|
||||
|
||||
def test_get_hooks(self, grpc_server: CoreGrpcServer):
|
||||
# given
|
||||
client = CoreGrpcClient()
|
||||
session = grpc_server.coreemu.create_session()
|
||||
file_name = "test"
|
||||
file_data = "echo hello"
|
||||
session.add_hook(EventTypes.RUNTIME_STATE, file_name, file_data)
|
||||
|
||||
# then
|
||||
with client.context_connect():
|
||||
response = client.get_hooks(session.id)
|
||||
|
||||
# then
|
||||
assert len(response.hooks) == 1
|
||||
hook = response.hooks[0]
|
||||
assert hook.state == core_pb2.SessionState.RUNTIME
|
||||
assert hook.file == file_name
|
||||
assert hook.data == file_data
|
||||
|
||||
def test_add_hook(self, grpc_server: CoreGrpcServer):
|
||||
# given
|
||||
client = CoreGrpcClient()
|
||||
session = grpc_server.coreemu.create_session()
|
||||
|
||||
# then
|
||||
file_name = "test"
|
||||
file_data = "echo hello"
|
||||
with client.context_connect():
|
||||
response = client.add_hook(
|
||||
session.id, core_pb2.SessionState.RUNTIME, file_name, file_data
|
||||
)
|
||||
|
||||
# then
|
||||
assert response.result is True
|
||||
|
||||
def test_save_xml(self, grpc_server: CoreGrpcServer, tmpdir: TemporaryFile):
|
||||
# given
|
||||
client = CoreGrpcClient()
|
||||
|
|
|
@ -408,38 +408,6 @@ class TestGrpcw:
|
|||
# then
|
||||
assert terminal is not None
|
||||
|
||||
def test_get_hooks(self, grpc_server: CoreGrpcServer):
|
||||
# given
|
||||
client = CoreGrpcClient()
|
||||
session = grpc_server.coreemu.create_session()
|
||||
file_name = "test"
|
||||
file_data = "echo hello"
|
||||
session.add_hook(EventTypes.RUNTIME_STATE, file_name, file_data)
|
||||
|
||||
# then
|
||||
with client.context_connect():
|
||||
hooks = client.get_hooks(session.id)
|
||||
|
||||
# then
|
||||
assert len(hooks) == 1
|
||||
hook = hooks[0]
|
||||
assert hook.state == SessionState.RUNTIME
|
||||
assert hook.file == file_name
|
||||
assert hook.data == file_data
|
||||
|
||||
def test_add_hook(self, grpc_server: CoreGrpcServer):
|
||||
# given
|
||||
client = CoreGrpcClient()
|
||||
session = grpc_server.coreemu.create_session()
|
||||
hook = Hook(SessionState.RUNTIME, "test", "echo hello")
|
||||
|
||||
# then
|
||||
with client.context_connect():
|
||||
result = client.add_hook(session.id, hook)
|
||||
|
||||
# then
|
||||
assert result is True
|
||||
|
||||
def test_save_xml(self, grpc_server: CoreGrpcServer, tmpdir: TemporaryFile):
|
||||
# given
|
||||
client = CoreGrpcClient()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue