Skip to content

Fix broken test GetCustomHooks_nonExistentHooks

Sami Hiltunen requested to merge smh-fix-get-custom-hooks-test into master

GetCustomHooks_nonExistentHooks is testing a scenario where a repository doesn't have custom hooks. It expects GetCustomHooks to return an empty result. The test is wrapping the stream in a tar.Reader which causes it to never actually read the stream. The test body is asserting that the result is empty by reading from the tar.Reader. Hoewever, it never advances the reader with a call to .Next() before reading. This means the reader returns an empty result on the Read call even if the response actually returned an archive with files inside. Fix this by just reading the byte stream directly and asserting no bytes were returned.

Merge request reports