Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
tests: better handle websocket client
[src/xds/xds-server.git]
/
test
/
target_test.go
diff --git
a/test/target_test.go
b/test/target_test.go
index
696c8fc
..
1cfaa94
100644
(file)
--- a/
test/target_test.go
+++ b/
test/target_test.go
@@
-70,10
+70,7
@@
func TestTarget(t *testing.T) {
chTerm := make(chan xsapiv1.TerminalOutMsg)
defer close(chTerm)
chTerm := make(chan xsapiv1.TerminalOutMsg)
defer close(chTerm)
- sCli, err := NewIoSocketClient(prefixURL, HTTPCli.GetClientID())
- if err != nil {
- t.Fatal(err)
- }
+
sCli.Conn.On(xsapiv1.TerminalOutEvent, func(ev xsapiv1.TerminalOutMsg) {
chTerm <- ev
})
sCli.Conn.On(xsapiv1.TerminalOutEvent, func(ev xsapiv1.TerminalOutMsg) {
chTerm <- ev
})
@@
-106,7
+103,7
@@
func TestTarget(t *testing.T) {
flushChannelTerm(chTerm, 50)
/*check that toto file is created*/
flushChannelTerm(chTerm, 50)
/*check that toto file is created*/
- _, err = os.Stat(totoFileCurrent)
+ _, err
:
= os.Stat(totoFileCurrent)
assert.Nil(t, err)
data = []byte("cat " + totoFileCurrent + "\n")
assert.Nil(t, err)
data = []byte("cat " + totoFileCurrent + "\n")