-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sqlite_releases (add _parser.py support for it, and a test).
For #205.
- Loading branch information
Showing
4 changed files
with
109 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html><head> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<title>Release History Of SQLite</title> | ||
<!-- path= --> | ||
</head> | ||
<body> | ||
|
||
<h1 align=center>Release History</h1> | ||
|
||
<p> | ||
This page provides a high-level summary of changes to SQLite. | ||
</p> | ||
|
||
<a name="version_3_34_1"></a> | ||
<h3>2021-01-20 (3.34.1)</h3><p><ol class='lessindent'> | ||
<li>Fix a potential use-after-free bug. | ||
</ol></p> | ||
<a name="version_3_34_0"></a> | ||
<h3>2020-12-01 (3.34.0)</h3><p> | ||
Added the <a href="c3ref/txn_state.html">sqlite3_txn_state()</a> interface. | ||
</p> | ||
<h3>2000-05-30</h3> | ||
Added the <b>LIKE</b> operator. | ||
<h3>2000-05-29</h3> | ||
Initial Public Release of Alpha code | ||
|
||
</dl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
from datetime import datetime | ||
|
||
from reader._plugins.sqlite_releases import FULL_URL | ||
from reader._plugins.sqlite_releases import init | ||
|
||
|
||
def test_sqlite_releases(reader, requests_mock, data_dir): | ||
init(reader) | ||
|
||
requests_mock.get( | ||
FULL_URL, | ||
content=data_dir.join('sqlite_releases.html').read_binary(), | ||
headers={ | ||
"Last-Modified": "Thu, 21 Jan 2021 01:23:58 +0000", | ||
"ETag": "m6008d7aes58501", | ||
"Content-type": "text/html; charset=utf-8", | ||
}, | ||
) | ||
|
||
reader.add_feed(FULL_URL) | ||
reader.update_feeds() | ||
|
||
(feed,) = reader.get_feeds() | ||
assert feed.updated == datetime(2021, 1, 20, 0, 0) | ||
assert feed.title == 'Release History Of SQLite' | ||
assert feed.link == 'https://www.sqlite.org/changes.html' | ||
|
||
(feed_for_update,) = reader._storage.get_feeds_for_update(url=FULL_URL) | ||
assert feed_for_update.http_etag == 'm6008d7aes58501' | ||
assert feed_for_update.http_last_modified == 'Thu, 21 Jan 2021 01:23:58 +0000' | ||
|
||
entries = list(reader.get_entries()) | ||
entry_data = [(e.id, e.updated, e.title, e.link, e.summary) for e in entries] | ||
assert entry_data == [ | ||
( | ||
'2021-01-20 (3.34.1)', | ||
datetime(2021, 1, 20, 0, 0), | ||
'2021-01-20 (3.34.1)', | ||
'https://www.sqlite.org/changes.html#version_3_34_1', | ||
'<p></p><ol class="lessindent">\n<li>Fix a potential use-after-free bug.\n</li></ol>\n', | ||
), | ||
( | ||
'2020-12-01 (3.34.0)', | ||
datetime(2020, 12, 1, 0, 0), | ||
'2020-12-01 (3.34.0)', | ||
'https://www.sqlite.org/changes.html#version_3_34_0', | ||
'<p>\nAdded the <a href="c3ref/txn_state.html">sqlite3_txn_state()</a> interface.\n</p>\n', | ||
), | ||
( | ||
'2000-05-30', | ||
datetime(2000, 5, 30, 0, 0), | ||
'2000-05-30', | ||
'https://www.sqlite.org/changes.html', | ||
'\nAdded the <b>LIKE</b> operator.\n', | ||
), | ||
( | ||
'2000-05-29', | ||
datetime(2000, 5, 29, 0, 0), | ||
'2000-05-29', | ||
'https://www.sqlite.org/changes.html', | ||
'\nInitial Public Release of Alpha code\n\n\n', | ||
), | ||
] |