Navigation Menu

Skip to content

Commit

Permalink
Add test case to TestCompareInputPropertyValue
Browse files Browse the repository at this point in the history
- API returns additional value that isn't in the input
  • Loading branch information
lillchan committed May 11, 2020
1 parent afc971f commit 66240a8
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions openapi/common_test.go
Expand Up @@ -1020,6 +1020,54 @@ func TestCompareInputPropertyValueWithPayloadPropertyValue(t *testing.T) {
},
},
},
{
name: "required input list (objects) doesn't have a value returned by the API",
property: specSchemaDefinitionProperty{
Name: "list_prop",
Type: typeList,
ArrayItemsType: typeObject,
SpecSchemaDefinition: &specSchemaDefinition{
Properties: specSchemaDefinitionProperties{
&specSchemaDefinitionProperty{
Name: "group",
Type: typeString,
},
&specSchemaDefinitionProperty{
Name: "roles",
Type: typeList,
ArrayItemsType: typeString,
},
},
},
Required: true,
},
inputPropertyValue: []interface{}{
map[string]interface{}{
"group": "someGroup",
"roles": []interface{}{"role1", "role2"},
},
},
remoteValue: []interface{}{
map[string]interface{}{
"group": "someGroup",
"roles": []interface{}{"role1", "role2"},
},
map[string]interface{}{
"group": "unexpectedGroup",
"roles": []interface{}{"role3", "role4"},
},
},
expectedOutput: []interface{}{
map[string]interface{}{
"group": "someGroup",
"roles": []interface{}{"role1", "role2"},
},
map[string]interface{}{
"group": "unexpectedGroup",
"roles": []interface{}{"role3", "role4"},
},
},
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit 66240a8

Please sign in to comment.