feat(sources): retire Yahoo and CNBC feeds (#42)
This commit is contained in:
22
backend/internal/models/source_retirement_ticket42_test.go
Normal file
22
backend/internal/models/source_retirement_ticket42_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestTicket42OnlyRSSSourcesAreOperationalEvenIfLegacyRowsWereReenabled(t *testing.T) {
|
||||
sources := []Source{}
|
||||
for _, key := range []string{SourceYahooFinance, SourceCNBCBusiness, SourceWatcherGuru, SourceBloomberg, SourceInvesting} {
|
||||
key := key
|
||||
sources = append(sources, Source{ID: key, SourceKey: &key, Enabled: true, ArticleLimit: 77})
|
||||
want := key == SourceBloomberg || key == SourceInvesting
|
||||
if SupportedSourceKey(key) != want {
|
||||
t.Errorf("source %s supported=%v, want %v", key, SupportedSourceKey(key), want)
|
||||
}
|
||||
}
|
||||
got := OperationalSources(sources)
|
||||
if len(got) != 2 || *got[0].SourceKey != SourceBloomberg || *got[1].SourceKey != SourceInvesting {
|
||||
t.Fatal("legacy SQL-enabled source remained operational")
|
||||
}
|
||||
if !sources[0].Enabled || *sources[0].SourceKey != "yahoo_finance" || sources[0].ArticleLimit != 77 || *sources[1].SourceKey != "cnbc_business" {
|
||||
t.Fatal("filter mutated historical identities/caps")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user