From 1aede2fc1c80276f093e446c9013b74c59eff0ae Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Sun, 15 Nov 2026 12:44:05 +0100 Subject: [PATCH] Let the server test accept the news feeds and the pinned model host (refs #57) The news collector runs alongside the market data in the server test, so its feeds and the Hugging Face download of the classifier can reach the fake network before the assertion: they are the hosts the code declares, nothing else. Co-Authored-By: Claude Opus 5.5 --- tests/Anubis.Tests/MarketDataServerTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Anubis.Tests/MarketDataServerTests.cs b/tests/Anubis.Tests/MarketDataServerTests.cs index 1404628..1e79881 100644 --- a/tests/Anubis.Tests/MarketDataServerTests.cs +++ b/tests/Anubis.Tests/MarketDataServerTests.cs @@ -40,8 +40,10 @@ public sealed class MarketDataServerTests StringAssert.Contains(bySource[MarketDataService.AlpacaSource].GetProperty("note").GetString(), "ALPACA_API_KEY_DEMO"); StringAssert.Contains(bySource[MarketDataService.OkxSource].GetProperty("note").GetString(), "3 nuovi"); Assert.AreEqual(JsonValueKind.Null, bySource[MarketDataService.OkxSource].GetProperty("lastError").ValueKind); + // The news of Phase 7 run on the same network: their feeds and the pinned classifier model, nothing else. + var news = Anubis.News.NewsStore.Defaults.Select(s => new Uri(s.Url).Host).Append(Anubis.News.ToneModel.Url.Host).ToHashSet(); Assert.IsTrue(network.Urls.All(u => u.Host is "eea.okx.com" or "data.binance.vision" or "nfs.faireconomy.media" or "www.ecb.europa.eu" - or "api.alternative.me" or "cdn.cboe.com"), string.Join(", ", network.Urls.Select(u => u.Host).Distinct())); + or "api.alternative.me" or "cdn.cboe.com" || news.Contains(u.Host)), string.Join(", ", network.Urls.Select(u => u.Host).Distinct())); Assert.IsFalse(network.Urls.Any(u => u.Host.Contains("alpaca", StringComparison.Ordinal)), "no call to Alpaca without keys"); var report = await server.TextAsync("/api/data/quality?format=md");