Commit 6e294c30 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

commands: Fixed tests

parent 18c50f34
......@@ -11,14 +11,14 @@ func TestOptionValidation(t *testing.T) {
f: func(req *Request, res *Response) {},
}
req := NewRequest()
req := NewEmptyRequest()
req.options["foo"] = 5
res := cmd.Call(req)
if res.Error == nil {
t.Error("Should have failed (unrecognized option)")
}
req = NewRequest()
req = NewEmptyRequest()
req.options["beep"] = 5
req.options["b"] = 10
res = cmd.Call(req)
......@@ -26,21 +26,21 @@ func TestOptionValidation(t *testing.T) {
t.Error("Should have failed (duplicate options)")
}
req = NewRequest()
req = NewEmptyRequest()
req.options["beep"] = "foo"
res = cmd.Call(req)
if res.Error == nil {
t.Error("Should have failed (incorrect type)")
}
req = NewRequest()
req = NewEmptyRequest()
req.options["beep"] = 5
res = cmd.Call(req)
if res.Error != nil {
t.Error(res.Error, "Should have passed")
}
req = NewRequest()
req = NewEmptyRequest()
req.options["beep"] = 5
req.options["boop"] = "test"
res = cmd.Call(req)
......@@ -48,7 +48,7 @@ func TestOptionValidation(t *testing.T) {
t.Error("Should have passed")
}
req = NewRequest()
req = NewEmptyRequest()
req.options["b"] = 5
req.options["B"] = "test"
res = cmd.Call(req)
......@@ -56,21 +56,21 @@ func TestOptionValidation(t *testing.T) {
t.Error("Should have passed")
}
req = NewRequest()
req = NewEmptyRequest()
req.options["enc"] = "json"
res = cmd.Call(req)
if res.Error != nil {
t.Error("Should have passed")
}
req = NewRequest()
req = NewEmptyRequest()
req.options["b"] = "100"
res = cmd.Call(req)
if res.Error != nil {
t.Error("Should have passed")
}
req = NewRequest()
req = NewEmptyRequest()
req.options["b"] = ":)"
res = cmd.Call(req)
if res.Error == nil {
......
......@@ -11,7 +11,7 @@ type TestOutput struct {
}
func TestMarshalling(t *testing.T) {
req := NewRequest()
req := NewEmptyRequest()
res := Response{
req: req,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment