test: add unit tests for database and Gitea client
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
20
internal/gitea/client_test.go
Normal file
20
internal/gitea/client_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user