Skip to content

Commit b116bd1

Browse files
committed
Added test
1 parent 5997da2 commit b116bd1

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

bot_test.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,23 @@ func TestBot_Logger(t *testing.T) {
158158
}
159159

160160
func TestBot_FileDownloadURL(t *testing.T) {
161-
bot, err := NewBot(token)
162-
require.NoError(t, err)
161+
t.Run("regular", func(t *testing.T) {
162+
bot, err := NewBot(token)
163+
require.NoError(t, err)
163164

164-
filepath := "file.txt"
165-
url := bot.FileDownloadURL(filepath)
166-
assert.Equal(t, bot.apiURL+"/file"+botPathPrefix+bot.token+"/"+filepath, url)
165+
filepath := "file.txt"
166+
url := bot.FileDownloadURL(filepath)
167+
assert.Equal(t, bot.apiURL+"/file"+botPathPrefix+bot.token+"/"+filepath, url)
168+
})
169+
170+
t.Run("test", func(t *testing.T) {
171+
bot, err := NewBot(token, WithTestServerPath())
172+
require.NoError(t, err)
173+
174+
filepath := "file.txt"
175+
url := bot.FileDownloadURL(filepath)
176+
assert.Equal(t, bot.apiURL+"/file"+botPathPrefix+bot.token+"/test/"+filepath, url)
177+
})
167178
}
168179

169180
type testErrorMarshal struct {

0 commit comments

Comments
 (0)