feat(sources): retire Yahoo and CNBC feeds (#42)
This commit is contained in:
@ -56,8 +56,8 @@ func TestLegacyNullFIGIAssetStillContributesToGenerationPostgres(t *testing.T) {
|
||||
`CREATE TABLE settings (key TEXT PRIMARY KEY, value TEXT NOT NULL)`,
|
||||
`INSERT INTO users(id,language,ranking_mode) VALUES ('` + userID + `','fr','title')`,
|
||||
`INSERT INTO user_assets(id,user_id,symbol,name,figi) VALUES ('00000000-0000-0000-0000-000000000411','` + userID + `','LEGACY','Historic asset',NULL)`,
|
||||
`INSERT INTO sources(id,name,type,enabled,article_limit,source_key) VALUES ('00000000-0000-0000-0000-000000000421','test source','ticket4',TRUE,20,'yahoo_finance')`,
|
||||
`INSERT INTO sources(id,name,type,enabled,article_limit,source_key) VALUES ('00000000-0000-0000-0000-000000000422','Historic enabled','reuters',TRUE,42,NULL),('00000000-0000-0000-0000-000000000423','Disabled target','bloomberg',FALSE,77,'bloomberg')`,
|
||||
`INSERT INTO sources(id,name,type,enabled,article_limit,source_key) VALUES ('00000000-0000-0000-0000-000000000421','test source','ticket4',TRUE,20,'bloomberg')`,
|
||||
`INSERT INTO sources(id,name,type,enabled,article_limit,source_key) VALUES ('00000000-0000-0000-0000-000000000422','Historic enabled','reuters',TRUE,42,NULL),('00000000-0000-0000-0000-000000000423','Disabled target','bloomberg',FALSE,77,'investing_com')`,
|
||||
`INSERT INTO settings(key,value) VALUES ('summary_max_articles','50'),('ai_system_prompt','Configured generation context')`,
|
||||
} {
|
||||
if _, err := db.Exec(statement); err != nil {
|
||||
@ -72,7 +72,7 @@ func TestLegacyNullFIGIAssetStillContributesToGenerationPostgres(t *testing.T) {
|
||||
if input.SummaryContext != "Configured generation context" {
|
||||
t.Fatal("existing generation context lost")
|
||||
}
|
||||
if len(input.Sources) != 1 || input.Sources[0].SourceKey == nil || *input.Sources[0].SourceKey != models.SourceYahooFinance || input.Sources[0].ArticleLimit != 20 {
|
||||
if len(input.Sources) != 1 || input.Sources[0].SourceKey == nil || *input.Sources[0].SourceKey != models.SourceBloomberg || input.Sources[0].ArticleLimit != 20 {
|
||||
t.Fatalf("LoadUserInput must exclude unsupported/disabled sources, preserving target caps: %+v", input.Sources)
|
||||
}
|
||||
if len(input.Assets) != 1 || input.Assets[0].Symbol != "LEGACY" || input.Assets[0].Name != "Historic asset" {
|
||||
@ -91,7 +91,7 @@ func TestLegacyNullFIGIAssetStillContributesToGenerationPostgres(t *testing.T) {
|
||||
fakeRepository := &contractRepository{inputs: map[string]UserInput{userID: input}, saved: map[string][]GenerationRecord{}}
|
||||
uc := NewUseCase(Dependencies{
|
||||
Repository: fakeRepository,
|
||||
Scrapers: map[string]scraper.Scraper{models.SourceYahooFinance: feed},
|
||||
Scrapers: map[string]scraper.Scraper{models.SourceBloomberg: feed},
|
||||
Ranker: ranker,
|
||||
Summarizer: summarizer,
|
||||
Clock: func() time.Time { return time.Unix(1, 0).UTC() },
|
||||
|
||||
Reference in New Issue
Block a user