core/command: Add streaming output for long running commands.

This commit is contained in:
Chaitanya Bankanhal
2020-07-27 23:47:09 +05:30
committed by Nick Craig-Wood
parent 1cae4152f9
commit a9713cd0ed
2 changed files with 48 additions and 17 deletions

View File

@@ -3,6 +3,8 @@ package rc
import (
"context"
"fmt"
"net/http"
"net/http/httptest"
"os"
"runtime"
"testing"
@@ -135,10 +137,13 @@ func TestCoreQuit(t *testing.T) {
func TestCoreCommand(t *testing.T) {
call := Calls.Get("core/command")
var httpResponse http.ResponseWriter = httptest.NewRecorder()
in := Params{
"command": "version",
"opt": map[string]string{},
"arg": []string{},
"command": "version",
"opt": map[string]string{},
"arg": []string{},
"_response": &httpResponse,
}
got, err := call.Fn(context.Background(), in)
require.NoError(t, err)