Created
May 7, 2018 00:37
-
-
Save koral--/040aa648cd4eb8e934c7717f3932dcd6 to your computer and use it in GitHub Desktop.
Go unit test example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func TestDownloadFileUnreachableURL(t *testing.T) { | |
dummyFile, err := os.Open("/dev/null") | |
require.NoError(t, err) | |
err = downloadFile("http://unreachable.invalid", dummyFile) | |
require.Error(t, err) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment