Beispiel #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")
}
Beispiel #2
0
func (*urlParamsSuite) TestNewMaybeAddManyNil(c *gc.C) {
	params := gomaasapi.NewURLParams()
	params.MaybeAddMany("foo", nil)
	c.Assert(params.Values.Encode(), gc.Equals, "")
}
Beispiel #3
0
func (*urlParamsSuite) TestNewMaybeAddIntWithValue(c *gc.C) {
	params := gomaasapi.NewURLParams()
	params.MaybeAddInt("foo", 42)
	c.Assert(params.Values.Encode(), gc.Equals, "foo=42")
}
Beispiel #4
0
func (*urlParamsSuite) TestNewMaybeAddBoolTrue(c *gc.C) {
	params := gomaasapi.NewURLParams()
	params.MaybeAddBool("foo", true)
	c.Assert(params.Values.Encode(), gc.Equals, "foo=true")
}
Beispiel #5
0
func (*urlParamsSuite) TestNewParamsNonNilValues(c *gc.C) {
	params := gomaasapi.NewURLParams()
	c.Assert(params.Values, gc.NotNil)
}