tests: tag tests relying on a working internet access (#10939)

So they can easily be filtered-out when offline.
reviewable/pr10944/r1
Benoit Pierre 7 months ago committed by GitHub
parent 741302445b
commit 8f6fae81fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -322,14 +322,14 @@ describe("OPDS module #nocov", function()
describe("OPDS browser module", function()
describe("URL generation", function()
it("should generate search item", function()
it("should generate search item #internet", function()
local catalog = OPDSParser:parse(navigation_sample)
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "https://www.gutenberg.org/ebooks.opds/?format=opds")
assert.truthy(item_table)
assert.are.same(item_table[1].text, "\u{f002} " .. "Search")
end)
it("should generate URL on rel=subsection", function()
it("should generate URL on rel=subsection #internet", function()
local catalog = OPDSParser:parse(navigation_sample)
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "https://www.gutenberg.org/ebooks.opds/?format=opds")
@ -337,7 +337,7 @@ describe("OPDS module #nocov", function()
assert.are.same(item_table[2].title, "Popular")
assert.are.same(item_table[2].url, "https://www.gutenberg.org/ebooks/search.opds/?sort_order=downloads")
end)
it("should generate URL on rel=popular and rel=new", function()
it("should generate URL on rel=popular and rel=new #internet", function()
local catalog = OPDSParser:parse(popular_new_sample)
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://www.feedbooks.com/publicdomain/catalog.atom")
@ -347,7 +347,7 @@ describe("OPDS module #nocov", function()
assert.are.same(item_table[3].title, "Recently Added")
assert.are.same(item_table[3].url, "http://www.feedbooks.com/books/recent.atom")
end)
it("should use the main URL for faceted links as long as faceted links aren't properly supported", 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 item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.is/opds")
@ -356,7 +356,7 @@ describe("OPDS module #nocov", function()
end)
end)
it("should not fill item table incorrectly with thumbnail or image URL", function()
it("should not fill item table incorrectly with thumbnail or image URL #internet", function()
local catalog = OPDSParser:parse(facet_sample)
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.is/opds")

@ -15,14 +15,14 @@ describe("Translator module", function()
G_reader_settings:flush()
end)
-- add " #notest #nocov" to the it("description string") when it does not work anymore
it("should return translation", function()
it("should return translation #internet", function()
local translation_result = Translator:translate(dutch_wikipedia_text, "en")
assert.is.truthy(translation_result)
-- while some minor variation in the translation is possible it should
-- be between about 100 and 130 characters
assert.is_true(#translation_result > 50 and #translation_result < 200)
end)
it("should autodetect language", function()
it("should autodetect language #internet", function()
local detect_result = Translator:detect(dutch_wikipedia_text)
assert.is.same("nl", detect_result)
end)

Loading…
Cancel
Save