[fix]: Fix sitemap loader (#753)

This commit is contained in:
Richard Awoyemi
2023-10-07 00:24:15 +01:00
committed by GitHub
parent 540a0a3685
commit 1741d3bef6
4 changed files with 34 additions and 3 deletions

View File

@@ -27,6 +27,14 @@ class TestApp(unittest.TestCase):
self.app.add("https://example.com", metadata={"meta": "meta-data"})
self.assertEqual(self.app.user_asks, [["https://example.com", "web_page", {"meta": "meta-data"}]])
@patch("chromadb.api.models.Collection.Collection.add", MagicMock)
def test_add_sitemap(self):
"""
In addition to the test_add function, this test checks that sitemaps can be added with the correct data type.
"""
self.app.add("https://www.google.com/sitemap.xml", metadata={"meta": "meta-data"})
self.assertEqual(self.app.user_asks, [["https://www.google.com/sitemap.xml", "sitemap", {"meta": "meta-data"}]])
@patch("chromadb.api.models.Collection.Collection.add", MagicMock)
def test_add_forced_type(self):
"""