예제 #1
0
func (*urlParamsSuite) TestNewMaybeAddManyValues(c *gc.C) {
	params := gomaasapi.NewURLParams()
	params.MaybeAddMany("foo", []string{"two", "", "values"})
	c.Assert(params.Values.Encode(), gc.Equals, "foo=two&foo=values")
}
예제 #2
0
func (*urlParamsSuite) TestNewMaybeAddManyNil(c *gc.C) {
	params := gomaasapi.NewURLParams()
	params.MaybeAddMany("foo", nil)
	c.Assert(params.Values.Encode(), gc.Equals, "")
}
예제 #3
0
func (*urlParamsSuite) TestNewMaybeAddIntWithValue(c *gc.C) {
	params := gomaasapi.NewURLParams()
	params.MaybeAddInt("foo", 42)
	c.Assert(params.Values.Encode(), gc.Equals, "foo=42")
}
예제 #4
0
func (*urlParamsSuite) TestNewMaybeAddBoolTrue(c *gc.C) {
	params := gomaasapi.NewURLParams()
	params.MaybeAddBool("foo", true)
	c.Assert(params.Values.Encode(), gc.Equals, "foo=true")
}
예제 #5
0
func (*urlParamsSuite) TestNewParamsNonNilValues(c *gc.C) {
	params := gomaasapi.NewURLParams()
	c.Assert(params.Values, gc.NotNil)
}