Cleaned up documentation and removed stubs and TODOs throughout the application
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/ejr/feedkit/config"
|
||||
@@ -39,6 +40,27 @@ func TestNewHTTPSourceRejectsInvalidConditional(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatalf("NewHTTPSource() error = nil, want error")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "params.conditional must be a boolean") {
|
||||
t.Fatalf("NewHTTPSource() error = %q, want params.conditional must be a boolean", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewHTTPSourceConditionalCanBeExplicitlyFalse(t *testing.T) {
|
||||
src, err := NewHTTPSource("test_driver", config.SourceConfig{
|
||||
Name: "test-source",
|
||||
Driver: "test_driver",
|
||||
Params: map[string]any{
|
||||
"url": "https://example.invalid",
|
||||
"user_agent": "test-agent",
|
||||
"conditional": false,
|
||||
},
|
||||
}, "application/json")
|
||||
if err != nil {
|
||||
t.Fatalf("NewHTTPSource() error = %v", err)
|
||||
}
|
||||
if src.Conditional {
|
||||
t.Fatalf("Conditional = true, want false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTTPSourceFetchJSONIfChanged(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user