From fa11b24fa85c08c09376354815241452fe0a2af1 Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Thu, 23 Jul 2020 15:47:49 +0200 Subject: [PATCH] Add test for non-existing file when downloading github contents --- lib/github/contents_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/github/contents_test.go b/lib/github/contents_test.go index 1a8a3ce..df0cdfd 100644 --- a/lib/github/contents_test.go +++ b/lib/github/contents_test.go @@ -20,4 +20,9 @@ func TestDownloadContents(t *testing.T) { assert.NotEmpty(contents) assert.Equal(string(readme), string(contents)) } + + contents, err = gh.DownloadContents(context.Background(), "philips-labs", "tabia", "IamNotThere.txt") + if assert.Error(err) { + assert.EqualError(err, "No file named IamNotThere.txt found in .") + } }