Skip to content

Remove response check in Delete* call tests #515

@artek-koltun

Description

@artek-koltun

In many Delete* calls, a response is checked as

if reflect.TypeOf(response) != reflect.TypeOf(tt.out) {
    t.Error("response: expected", reflect.TypeOf(tt.out), "received", reflect.TypeOf(response))
}

However, this check does not make much sense. response is returned from a Delete* client function call, which has a concrete type *emptypb.Empty. Any other type cannot be returned from there, since Go is a statically typed language.
Then response is compared against an expectation referred also as *emptypb.Empty. Thus, we just compare that response's type *emptypb.Empty is equal to out's type *emptypb.Empty. The result is always true.

Also, emptypb.Empty represents an empty message in gRPC. It does not have any exported fields, and we do not have anything to check there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions