blob: a4f03ef2f12a52ef234845184c1284bbec407388 [file] [log] [blame]
Joe Topjian1e9551c2017-06-03 10:35:33 -06001package testing
2
3import (
4 "testing"
5
6 "gerrit.mcp.mirantis.net/debian/gophercloud.git/internal"
7 th "gerrit.mcp.mirantis.net/debian/gophercloud.git/testhelper"
8)
9
10func TestRemainingKeys(t *testing.T) {
11 type User struct {
12 FirstName string `json:"first_name"`
13 LastName string `json:"last_name"`
14 City string
15 }
16
17 userStruct := User{
18 FirstName: "John",
19 LastName: "Doe",
20 }
21
22 userMap := map[string]interface{}{
23 "first_name": "John",
24 "last_name": "Doe",
25 "city": "Honolulu",
26 "state": "Hawaii",
27 }
28
29 expected := map[string]interface{}{
30 "city": "Honolulu",
31 "state": "Hawaii",
32 }
33
34 actual := internal.RemainingKeys(userStruct, userMap)
35 th.AssertDeepEquals(t, expected, actual)
36}