(t *testing.T)
| 118 | } |
| 119 | |
| 120 | func TestEncodeValues(t *testing.T) { |
| 121 | RegisterFailHandler(Fail) |
| 122 | |
| 123 | DescribeTable("Encoding Values", func(value, expected string) { |
| 124 | key := "testvalue" |
| 125 | values := url.Values{} |
| 126 | values.Set(key, value) |
| 127 | Expect(cloudstack.EncodeValues(values)).To(Equal(fmt.Sprintf("%s=%s", key, expected))) |
| 128 | }, |
| 129 | Entry("When asterisk is in value it shouldn't encode asterisk", "*.example.com", "*.example.com"), |
| 130 | Entry("When question mark is in value it should encode question mark", "foo?", "foo%3F"), |
| 131 | Entry("When question mark and asterisk is in value it should encode only question mark", "*.foo?", "*.foo%3F"), |
| 132 | Entry("When a space is involved, should encode to %20 and not a +", "this that", "this%20that"), |
| 133 | ) |
| 134 | |
| 135 | RunSpecs(t, "Encoding Suite") |
| 136 | } |
| 137 | |
| 138 | type UUIDStruct struct { |
| 139 | Value cloudstack.UUID `json:"value"` |
nothing calls this directly
no test coverage detected