Add ut for GetComponentStates (#12968)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/12975/head
dragondriver 2021-12-08 15:17:31 +08:00 committed by GitHub
parent 8f2c630434
commit 19ad282810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -2572,3 +2572,11 @@ func TestProxy_GetComponentStates(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, commonpb.ErrorCode_Success, resp.Status.ErrorCode)
}
func TestProxy_GetComponentStates_state_code(t *testing.T) {
p := &Proxy{}
p.stateCode.Store("not internalpb.StateCode")
states, err := p.GetComponentStates(context.Background())
assert.NoError(t, err)
assert.NotEqual(t, commonpb.ErrorCode_Success, states.Status.ErrorCode)
}