Begin to refactor websocket handling and implement test

Co-authored-by: Felix Auringer <felix.auringer@student.hpi.uni-potsdam.de>
This commit is contained in:
Konrad Hanff
2021-03-30 16:10:19 +02:00
committed by Sebastian Serth
parent 3cf70a33d8
commit 1546f70818
3 changed files with 78 additions and 58 deletions

View File

@ -37,16 +37,19 @@ class Container
response
end
def execute_command_interactively(command)
def execute_interactively(command)
websocket_url = execute_command(command)[:websocket_url]
@socket = Faye::WebSocket::Client.new(websocket_url, [], ping: 0.1)
# Faye::WebSocket::Client.new(socket_url, [], headers: headers, ping: 0.1)
end
def destroy
Faraday.delete container_url
end
def status
parse(Faraday.get(container_url))[:status]
end
private
def container_url