From 8f6fae81faa4233214415e8c9e9798ce3b113eb8 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sun, 24 Sep 2023 16:18:03 +0000 Subject: [PATCH] tests: tag tests relying on a working internet access (#10939) So they can easily be filtered-out when offline. --- spec/unit/opds_spec.lua | 10 +++++----- spec/unit/translator_spec.lua | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/unit/opds_spec.lua b/spec/unit/opds_spec.lua index ad798e0c8..518cd7323 100644 --- a/spec/unit/opds_spec.lua +++ b/spec/unit/opds_spec.lua @@ -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") diff --git a/spec/unit/translator_spec.lua b/spec/unit/translator_spec.lua index e1957cf30..9ca601cf5 100644 --- a/spec/unit/translator_spec.lua +++ b/spec/unit/translator_spec.lua @@ -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)