pages-server/server/gitea/client_test.go
6543 02bd942b04 Move gitea api calls in own "client" package (#78)
continue #75
close #16
- fix regression (from #34) _thanks to @crystal_
- create own gitea client package
- more logging
- add mock impl of CertDB

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: crystal <crystal@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/78
Reviewed-by: crapStone <crapstone@noreply.codeberg.org>
2022-06-11 23:02:06 +02:00

24 lines
535 B
Go

package gitea
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestJoinURL(t *testing.T) {
url := joinURL("")
assert.EqualValues(t, "", url)
url = joinURL("", "", "")
assert.EqualValues(t, "", url)
url = joinURL("http://wwow.url.com", "a", "b/c/", "d")
// assert.EqualValues(t, "http://wwow.url.com/a/b/c/d", url)
assert.EqualValues(t, "http://wwow.url.coma/b/c/d", url)
url = joinURL("h:://wrong", "acdc")
// assert.EqualValues(t, "h:://wrong/acdc", url)
assert.EqualValues(t, "h:://wrongacdc", url)
}