Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove response check in Delete* call tests #515

Open
artek-koltun opened this issue Jul 4, 2023 · 0 comments
Open

Remove response check in Delete* call tests #515

artek-koltun opened this issue Jul 4, 2023 · 0 comments

Comments

@artek-koltun
Copy link
Contributor

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.

@artek-koltun artek-koltun changed the title Remove response check in Delete* calls Remove response check in Delete* call tests Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant