Mercurial > silorider
diff tests/test_format.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 | c898b4df0f29 |
line wrap: on
line diff
--- a/tests/test_format.py Sun Sep 08 16:09:40 2019 -0700 +++ b/tests/test_format.py Sun Sep 08 16:11:26 2019 -0700 @@ -5,15 +5,19 @@ test_url = 'https://example.org/article' -class TestEntry: - pass - +def _make_test_entry(best_name, is_micropost): + class TestEntry: + def __init__(self): + self.is_micropost = is_micropost + self.url = test_url -def _make_test_entry(best_name, is_micropost): + def get(self, _): + return best_name + + def htmlFind(self, *args, **kwargs): + return best_name + entry = TestEntry() - entry.get = lambda n: best_name - entry.is_micropost = is_micropost - entry.url = test_url return entry