fix TestLists_PostList test
This commit is contained in:
parent
e3925732a7
commit
fcdcafbb2e
@ -243,6 +243,11 @@ func IsErrItemAlreadyExistsConflict(err error) bool {
|
||||
parseODataErr(err).hasErrorCode(err, nameAlreadyExists)
|
||||
}
|
||||
|
||||
func IsErrNameAlreadyExistsConflict(err error) bool {
|
||||
return errors.Is(err, ErrNameAlreadyExistsConflict) ||
|
||||
parseODataErr(err).hasErrorCode(err, nameAlreadyExists)
|
||||
}
|
||||
|
||||
// LabelStatus transforms the provided statusCode into
|
||||
// a standard label that can be attached to a clues error
|
||||
// and later reviewed when checking error statuses.
|
||||
|
||||
@ -758,7 +758,7 @@ func (suite *ListsAPIIntgSuite) TestLists_PostList() {
|
||||
|
||||
_, err = acl.PostList(ctx, siteID, listName, oldListByteArray, fault.New(true))
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, graph.ErrNameAlreadyExistsConflict, err)
|
||||
assert.True(t, graph.IsErrNameAlreadyExistsConflict(err))
|
||||
|
||||
newListItems := newList.GetItems()
|
||||
require.Less(t, 0, len(newListItems))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user