21 lines
357 B
Go
21 lines
357 B
Go
package gitea
|
|
|
|
import "testing"
|
|
|
|
func TestNewClient(t *testing.T) {
|
|
client, err := NewClient("https://gitea.com", "")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if client == nil {
|
|
t.Error("client is nil")
|
|
}
|
|
}
|
|
|
|
func TestNewClientInvalidURL(t *testing.T) {
|
|
_, err := NewClient("://invalid", "")
|
|
if err == nil {
|
|
t.Error("expected error for invalid URL")
|
|
}
|
|
}
|