Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
0b509098
Commit
0b509098
authored
Nov 17, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Fixed tests
parent
d4ac4428
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
commands/command_test.go
commands/command_test.go
+8
-8
commands/response_test.go
commands/response_test.go
+1
-1
No files found.
commands/command_test.go
View file @
0b509098
...
...
@@ -17,21 +17,21 @@ func TestOptionValidation(t *testing.T) {
opts
,
_
:=
cmd
.
GetOptions
(
nil
)
req
,
_
:=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
:=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
req
.
SetOption
(
"beep"
,
true
)
res
:=
cmd
.
Call
(
req
)
if
res
.
Error
()
==
nil
{
t
.
Error
(
"Should have failed (incorrect type)"
)
}
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
req
.
SetOption
(
"beep"
,
5
)
res
=
cmd
.
Call
(
req
)
if
res
.
Error
()
!=
nil
{
t
.
Error
(
res
.
Error
(),
"Should have passed"
)
}
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
req
.
SetOption
(
"beep"
,
5
)
req
.
SetOption
(
"boop"
,
"test"
)
res
=
cmd
.
Call
(
req
)
...
...
@@ -39,7 +39,7 @@ func TestOptionValidation(t *testing.T) {
t
.
Error
(
"Should have passed"
)
}
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
req
.
SetOption
(
"b"
,
5
)
req
.
SetOption
(
"B"
,
"test"
)
res
=
cmd
.
Call
(
req
)
...
...
@@ -47,28 +47,28 @@ func TestOptionValidation(t *testing.T) {
t
.
Error
(
"Should have passed"
)
}
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
req
.
SetOption
(
"foo"
,
5
)
res
=
cmd
.
Call
(
req
)
if
res
.
Error
()
!=
nil
{
t
.
Error
(
"Should have passed"
)
}
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
req
.
SetOption
(
EncShort
,
"json"
)
res
=
cmd
.
Call
(
req
)
if
res
.
Error
()
!=
nil
{
t
.
Error
(
"Should have passed"
)
}
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
req
.
SetOption
(
"b"
,
"100"
)
res
=
cmd
.
Call
(
req
)
if
res
.
Error
()
!=
nil
{
t
.
Error
(
"Should have passed"
)
}
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
req
.
SetOption
(
"b"
,
":)"
)
res
=
cmd
.
Call
(
req
)
if
res
.
Error
()
==
nil
{
...
...
commands/response_test.go
View file @
0b509098
...
...
@@ -15,7 +15,7 @@ func TestMarshalling(t *testing.T) {
cmd
:=
&
Command
{}
opts
,
_
:=
cmd
.
GetOptions
(
nil
)
req
,
_
:=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
opts
)
req
,
_
:=
NewRequest
(
nil
,
nil
,
nil
,
nil
,
nil
,
opts
)
res
:=
NewResponse
(
req
)
res
.
SetOutput
(
TestOutput
{
"beep"
,
"boop"
,
1337
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment