diff tests/test_commands_populate.py @ 18:a921cc2306bc

Do our own HTML parsing/stripping of micropost contents. - This lets us properly handle various forms of linking. - Add tests for processing posts with links. - Fix configuration in tests. - Basic error handling for processing posts.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 16 Sep 2018 21:16:20 -0700
parents a1b7a459326a
children b739ca5feb45
line wrap: on
line diff
--- a/tests/test_commands_populate.py	Mon Jul 30 18:19:04 2018 -0700
+++ b/tests/test_commands_populate.py	Sun Sep 16 21:16:20 2018 -0700
@@ -13,9 +13,10 @@
 
 
 def test_populate(cli):
+    feed = cli.createTempFeed(feed1)
     cli.appendSiloConfig('test', 'print', items='name')
-    feed = cli.createTempFeed(feed1)
-    ctx, _ = cli.run('populate', feed, '-s', 'test')
+    cli.setFeedConfig('feed', feed)
+    ctx, _ = cli.run('populate', '-s', 'test')
     assert ctx.cache.wasPosted('test', 'https://example.org/a-new-article')
 
 
@@ -40,9 +41,10 @@
 
 
 def test_populate_until(cli):
+    feed = cli.createTempFeed(feed2)
     cli.appendSiloConfig('test', 'print', items='name')
-    feed = cli.createTempFeed(feed2)
-    ctx, _ = cli.run('populate', feed, '-s', 'test', '--until', '2018-01-08')
+    cli.setFeedConfig('feed', feed)
+    ctx, _ = cli.run('populate', '-s', 'test', '--until', '2018-01-08')
     assert ctx.cache.wasPosted('test', 'https://example.org/first-article')
     assert ctx.cache.wasPosted('test', 'https://example.org/second-article')
     assert not ctx.cache.wasPosted('test', 'https://example.org/third-article')