Mercurial > silorider
comparison tests/test_silos_twitter.py @ 25:fb93d3fbff4e
Support transforming twitter profile URLs into mentions.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 08 Sep 2019 16:11:26 -0700 |
parents | a921cc2306bc |
children | 9e4eb3f2754e |
comparison
equal
deleted
inserted
replaced
24:2d064ee0c5e6 | 25:fb93d3fbff4e |
---|---|
33 | 33 |
34 ctx, _ = cli.run('process') | 34 ctx, _ = cli.run('process') |
35 assert ctx.cache.wasPosted('test', '/01234.html') | 35 assert ctx.cache.wasPosted('test', '/01234.html') |
36 toot = ctx.silos[0].client.tweets[0] | 36 toot = ctx.silos[0].client.tweets[0] |
37 assert toot == ("This is a quick update.", []) | 37 assert toot == ("This is a quick update.", []) |
38 | |
39 | |
40 def test_one_micropost_with_mention(cli, feedutil, tweetmock): | |
41 feed = cli.createTempFeed(feedutil.makeFeed( | |
42 """<p class="p-name">Hey <a href="https://twitter.com/jack">Jacky</a> | |
43 you should fix your stuff!</p> | |
44 <a class="u-url" href="/01234.html">permalink</a>""" | |
45 )) | |
46 | |
47 cli.appendSiloConfig('test', 'twitter', url='/blah') | |
48 cli.setFeedConfig('feed', feed) | |
49 tweetmock.installTokens(cli, 'test') | |
50 | |
51 ctx, _ = cli.run('process') | |
52 assert ctx.cache.wasPosted('test', '/01234.html') | |
53 toot = ctx.silos[0].client.tweets[0] | |
54 assert toot == ("Hey @jack you should fix your stuff!", []) | |
38 | 55 |
39 | 56 |
40 def test_one_micropost_with_one_photo(cli, feedutil, tweetmock, monkeypatch): | 57 def test_one_micropost_with_one_photo(cli, feedutil, tweetmock, monkeypatch): |
41 feed = cli.createTempFeed(feedutil.makeFeed( | 58 feed = cli.createTempFeed(feedutil.makeFeed( |
42 """<p class="p-name">This is a quick photo update.</p> | 59 """<p class="p-name">This is a quick photo update.</p> |