local navigation_sample = [[ http://m.gutenberg.org/ebooks.opds/ 2014-05-17T12:04:49Z Project Gutenberg Free ebooks since 1971. Marcello Perathoner http://www.gutenberg.org webmaster@gutenberg.org http://m.gutenberg.org/pics/favicon.png 25 1 2014-05-17T12:04:49Z http://m.gutenberg.org/ebooks/search.opds/?sort_order=downloads Popular Our most popular books. 2014-05-17T12:04:49Z http://m.gutenberg.org/ebooks/search.opds/?sort_order=release_date Latest Our latest releases. 2014-05-17T12:04:49Z http://m.gutenberg.org/ebooks/search.opds/?sort_order=random Random Random books. ]] local acquisition_sample = [[ http://m.gutenberg.org:80/ebooks/42474.opds 2014-09-03T12:16:15Z 1000 Mythological Characters Briefly Described by Edward Sylvester Ellis Free ebooks since 1971. Marcello Perathoner http://www.gutenberg.org webmaster@gutenberg.org http://m.gutenberg.org:80/pics/favicon.png 25 1 2014-09-03T12:16:15Z 1000 Mythological Characters Briefly Described

This edition had all images removed.

Title: 1000 Mythological Characters Briefly Described
Adapted to Private Schools, High Schools and Academies

Author: Ellis, Edward Sylvester, 1840-1916

Ebook No.: 42474

Published: Apr 7, 2013

Downloads: 1209

Language: English

Category: Text

Rights: Public domain in the USA.

urn:gutenberg:42474:2 2013-04-07T00:00:00+00:00 Public domain in the USA. Ellis, Edward Sylvester en 1
2014-09-03T12:16:15Z 1000 Mythological Characters Briefly Described

This edition has images.

Title: 1000 Mythological Characters Briefly Described
Adapted to Private Schools, High Schools and Academies

Author: Ellis, Edward Sylvester, 1840-1916

Ebook No.: 42474

Published: Apr 7, 2013

Downloads: 1209

Language: English

Category: Text

Rights: Public domain in the USA.

urn:gutenberg:42474:3 2013-04-07T00:00:00+00:00 Public domain in the USA. Ellis, Edward Sylvester en 1
]] package.path = "?.lua;common/?.lua;frontend/?.lua" local OPDSParser = require("ui/opdsparser") local DEBUG = require("dbg") DEBUG:turnOn() describe("OPDS parser module", function() it("should parse OPDS navigation catalog", function() local catalog = OPDSParser:parse(navigation_sample) local feed = catalog.feed assert.truthy(feed) assert.are.same(feed.title, "Project Gutenberg") local entries = feed.entry assert.truthy(entries) assert.are.same(#entries, 3) local entry = entries[3] assert.are.same(entry.title, "Random") assert.are.same(entry.id, "http://m.gutenberg.org/ebooks/search.opds/?sort_order=random") end) it("should parse OPDS acquisition catalog", function() local catalog = OPDSParser:parse(acquisition_sample) local feed = catalog.feed --DEBUG(feed) assert.truthy(feed) local entries = feed.entry assert.truthy(entries) assert.are.same(#entries, 2) local entry = entries[2] --DEBUG(entry) assert.are.same(entry.title, "1000 Mythological Characters Briefly Described") assert.are.same(entry.link[1].href, "//www.gutenberg.org/ebooks/42474.epub.images") end) end)