tests/opds: fix no longer valid feedbooks.com URLs (#12185)

This commit is contained in:
Benoit Pierre
2024-07-19 16:58:32 +00:00
committed by GitHub
parent 7e3b9deb25
commit 36154f4747

View File

@@ -188,51 +188,50 @@ One Thousand Mythological Characters Briefly Described
local popular_new_sample = [[ local popular_new_sample = [[
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:opds4l="http://www.feedbooks.com/opds4l" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xml:lang="en" xmlns:app="http://www.w3.org/2007/app" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:opds="http://opds-spec.org/2010/catalog"> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xml:lang="en" xmlns:app="http://www.w3.org/2007/app" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:opds="http://opds-spec.org/2010/catalog">
<id>http://www.feedbooks.com/publicdomain/catalog.atom</id> <id>https://catalog.feedbooks.com/catalog/public_domain.atom</id>
<title>Public Domain Books</title> <title>Public Domain Books</title>
<updated>2014-11-30T17:54:01Z</updated> <updated>2014-11-30T17:54:01Z</updated>
<icon>http://assets3.feedbooks.net/images/favicon.ico?t=1417192326</icon> <icon>https://catalog.feedbooks.com/favicon.ico</icon>
<author> <author>
<name>Feedbooks</name> <name>Feedbooks</name>
<uri>http://www.feedbooks.com</uri> <uri>http://www.feedbooks.com</uri>
<email>support@feedbooks.zendesk.com</email> <email>help@demarque.com</email>
</author> </author>
<link type="application/atom+xml; profile=opds-catalog; kind=navigation" href="http://www.feedbooks.com/publicdomain/catalog.atom" rel="self"/> <link rel="self" type="application/atom+xml;profile=opds-catalog;kind=navigation; charset=utf-8" href="https://catalog.feedbooks.com/catalog/public_domain.atom"/>
<link type="application/atom+xml;profile=opds-catalog;kind=navigation" title="Home" href="http://www.feedbooks.com/catalog.atom" rel="start"/> <link rel="start" type="application/atom+xml;profile=opds-catalog;kind=navigation" title="Home" href="https://catalog.feedbooks.com/catalog/index.atom"/>
<link type="application/opensearchdescription+xml" title="Search on Feedbooks" href="http://www.feedbooks.com/opensearch.xml" rel="search"/> <link rel="search" href="https://catalog.feedbooks.com/opensearch.xml" type="application/opensearchdescription+xml" title="Search on Feedbooks"/>
<link type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Bookshelf" href="https://www.feedbooks.com/user/bookshelf.atom" rel="http://opds-spec.org/shelf"/> <link rel="http://opds-spec.org/featured" type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Featured books" href="https://catalog.feedbooks.com/publicdomain/browse/homepage_selection.atom?lang=en"/>
<link type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Featured Books" href="http://www.feedbooks.com/featured.atom?view=books" rel="http://opds-spec.org/featured"/> <link rel="http://opds-spec.org/sort/popular" type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Literary" href="https://catalog.feedbooks.com/publicdomain/browse/best.atom?cat=FBFIC019000&amp;lang=en"/>
<link type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Literary" href="http://www.feedbooks.com/books/top.atom?category=FBFIC019000" rel="http://opds-spec.org/sort/popular"/> <link rel="http://opds-spec.org/sort/popular" type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Mystery &amp; detective" href="https://catalog.feedbooks.com/publicdomain/browse/best.atom?cat=FBFIC022000&amp;lang=en"/>
<link type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Mystery &amp; Detective" href="http://www.feedbooks.com/books/top.atom?category=FBFIC022000" rel="http://opds-spec.org/sort/popular"/> <link rel="http://opds-spec.org/sort/popular" type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Science fiction" href="https://catalog.feedbooks.com/publicdomain/browse/best.atom?cat=FBFIC028000&amp;lang=en"/>
<link type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="Science Fiction" href="http://www.feedbooks.com/books/top.atom?category=FBFIC028000" rel="http://opds-spec.org/sort/popular"/>
<entry> <entry>
<title>Most Popular</title> <title>Most popular</title>
<link type="application/atom+xml;profile=opds-catalog;kind=acquisition" href="http://www.feedbooks.com/books/top.atom" rel="http://opds-spec.org/sort/popular"/> <link type="application/atom+xml;profile=opds-catalog;kind=acquisition" rel="http://opds-spec.org/sort/popular" href="https://catalog.feedbooks.com/publicdomain/browse/top.atom?lang=en"/>
<updated>2014-11-30T17:54:01Z</updated> <updated>2024-07-19T16:19:38Z</updated>
<id>http://www.feedbooks.com/books/top.atom</id> <id>https://catalog.feedbooks.com/publicdomain/browse/top.atom?lang=en</id>
<content type="text">Based on last week's downloads</content> <content type="text">Based on last week's downloads</content>
</entry> </entry>
<entry> <entry>
<title>Recently Added</title> <title>Recently added</title>
<link type="application/atom+xml;profile=opds-catalog;kind=acquisition" href="http://www.feedbooks.com/books/recent.atom" rel="http://opds-spec.org/sort/new"/> <link type="application/atom+xml;profile=opds-catalog;kind=acquisition" rel="http://opds-spec.org/sort/new" href="https://catalog.feedbooks.com/publicdomain/browse/recent.atom?lang=en"/>
<updated>2014-11-30T17:54:01Z</updated> <updated>2024-07-19T16:19:38Z</updated>
<id>http://www.feedbooks.com/books/recent.atom</id> <id>https://catalog.feedbooks.com/publicdomain/browse/recent.atom?lang=en</id>
<content type="text">Find the latest books available</content> <content type="text">Find the latest books available</content>
</entry> </entry>
<entry> <entry>
<title>Fiction</title> <title>Fiction</title>
<link type="application/atom+xml;profile=opds-catalog;kind=navigation" href="http://www.feedbooks.com/books/categories/FBFIC000000.atom?lang=en" rel="subsection"/> <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="subsection" href="https://catalog.feedbooks.com/publicdomain/category/FBFIC000000/sub.atom"/>
<updated>2014-11-30T17:54:01Z</updated> <updated>2024-07-19T16:19:38Z</updated>
<id>http://www.feedbooks.com/books/categories.atom</id> <id>https://catalog.feedbooks.com/publicdomain/category/FBFIC000000/sub.atom</id>
<content type="text">Browse book by category</content> <content type="text">Browse books by category</content>
</entry> </entry>
<entry> <entry>
<title>Non-Fiction</title> <title>Nonfiction</title>
<link type="application/atom+xml;profile=opds-catalog;kind=navigation" href="http://www.feedbooks.com/books/categories/FBNFC000000.atom?lang=en" rel="subsection"/> <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="subsection" href="https://catalog.feedbooks.com/publicdomain/category/FBNFC000000/sub.atom"/>
<updated>2014-11-30T17:54:01Z</updated> <updated>2024-07-19T16:19:38Z</updated>
<id>http://www.feedbooks.com/books/categories.atom</id> <id>https://catalog.feedbooks.com/publicdomain/category/FBNFC000000/sub.atom</id>
<content type="text">Browse book by category</content> <content type="text">Browse books by category</content>
</entry> </entry>
</feed> </feed>
]] ]]
@@ -342,10 +341,10 @@ describe("OPDS module #nocov", function()
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://www.feedbooks.com/publicdomain/catalog.atom") local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://www.feedbooks.com/publicdomain/catalog.atom")
assert.truthy(item_table) assert.truthy(item_table)
assert.are.same(item_table[2].title, "Most Popular") assert.are.same(item_table[2].title, "Most popular")
assert.are.same(item_table[2].url, "http://www.feedbooks.com/books/top.atom") assert.are.same(item_table[2].url, "https://catalog.feedbooks.com/publicdomain/browse/top.atom?lang=en")
assert.are.same(item_table[3].title, "Recently Added") assert.are.same(item_table[3].title, "Recently added")
assert.are.same(item_table[3].url, "http://www.feedbooks.com/books/recent.atom") assert.are.same(item_table[3].url, "https://catalog.feedbooks.com/publicdomain/browse/recent.atom?lang=en")
end) end)
it("should use the main URL for faceted links as long as faceted links aren't properly supported #internet", function() it("should use the main URL for faceted links as long as faceted links aren't properly supported #internet", function()
local catalog = OPDSParser:parse(facet_sample) local catalog = OPDSParser:parse(facet_sample)