Skip to content
Snippets Groups Projects
Commit 5053f286 authored by Gleb Kashkin's avatar Gleb Kashkin Committed by Alexander Turenko
Browse files

test: add roundtrip() to interactive_tarantool

Sometimes it is useful to have one function to execute command,
read and compare response.
This patch introduces such function - `roundtrip()` to
interactive_tarantool helper.

NO_CHANGELOG=test helper change
NO_TEST=test helper change
NO_DOC=test helper change
parent 05b696c7
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ local log = require('log')
local yaml = require('yaml')
local popen = require('popen')
local tnt = require('tarantool')
local t = require('luatest')
-- Default timeout for expecting an input on child's stdout.
--
......@@ -269,6 +270,15 @@ function mt.close(self)
self.ph:close()
end
-- Run a command and assert response.
function mt.roundtrip(self, command, expected)
self:execute_command(command)
local response = self:read_response()
if expected ~= nil then
t.assert_equals(response, expected)
end
end
-- }}} Instance methods
-- {{{ Module functions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment