test: fix TestIsNegative (#8783)

Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
He Weiwei 2019-08-22 15:27:49 +08:00 committed by GitHub
parent b47b30db23
commit 311028be37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,8 +77,12 @@ func (suite *ResourcesSuite) TestZero() {
}
func (suite *ResourcesSuite) TestIsNegative() {
suite.EqualValues([]ResourceName{ResourceStorage}, IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: 100}))
suite.EqualValues([]ResourceName{ResourceStorage, ResourceCount}, IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: -100}))
suite.Len(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: 100}), 1)
suite.Contains(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: 100}), ResourceStorage)
suite.Len(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: -100}), 2)
suite.Contains(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: -100}), ResourceStorage)
suite.Contains(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: -100}), ResourceCount)
}
func TestRunResourcesSuite(t *testing.T) {