From 76f07ae2006de9f39d40001bde2a9ef3e48049da Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Fri, 11 Nov 2022 22:38:51 +0100 Subject: [PATCH] Revert "drop twitter handle suffix for #115" This reverts commit e50d4871c2cc7f95cfbbba2288a896e5888cbb75. --- moa/tweet.py | 2 +- tests/test_tweets.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/moa/tweet.py b/moa/tweet.py index b156967..ca98762 100644 --- a/moa/tweet.py +++ b/moa/tweet.py @@ -16,7 +16,7 @@ from moa.models import CON_XP_ONLYIF, CON_XP_ONLYIF_TAGS, CON_XP_UNLESS, CON_XP_ logger = logging.getLogger('worker') HOUR_CUTOFF = 8 -HANDLE_SUFFIX = '' +HANDLE_SUFFIX = '@twitter.com' class Tweet(Message): diff --git a/tests/test_tweets.py b/tests/test_tweets.py index eb74279..30a9b62 100644 --- a/tests/test_tweets.py +++ b/tests/test_tweets.py @@ -51,7 +51,7 @@ class TestTweets(unittest.TestCase): tweet = Tweet(self.settings, status, self.api) - expected_content = 'RT @lorddeath\nTbh I need to find time to email @aaisp and be prepared to do some troubleshooting, as my “@a.1” line drops pretty much daily :( Even @aaisp can\'t force BT OpenReach to give me fully-stable lines :p' + expected_content = 'RT @lorddeath@twitter.com\nTbh I need to find time to email @aaisp@twitter.com and be prepared to do some troubleshooting, as my “@a@twitter.com.1” line drops pretty much daily :( Even @aaisp@twitter.com can\'t force BT OpenReach to give me fully-stable lines :p' self.assertEqual(expected_content, tweet.clean_content) @@ -59,7 +59,7 @@ class TestTweets(unittest.TestCase): status = self.thaw_tweet('mention_replacement_1') tweet = Tweet(self.settings, status, self.api) - expected_content = '#booster2019 was another great time. Lovely city, on-point organization (food, coffee), awesome talks & crowd (including an evolter, @MartinBurnsSCO).' + expected_content = '#booster2019 was another great time. Lovely city, on-point organization (food, coffee), awesome talks & crowd (including an evolter, @MartinBurnsSCO@twitter.com).' self.assertEqual(expected_content, tweet.clean_content) @@ -67,7 +67,7 @@ class TestTweets(unittest.TestCase): status = self.thaw_tweet('rt_with_entity_1') tweet = Tweet(self.settings, status, self.api) - expected_content = '+1 \n---\nRT @lisacrispin\nThanks again to all the wonderful, welcoming people who made @boosterconf amazing. Umbrellas, great food, perfect mix of session types & lengths, great diversity, wide range of topics, so fun. #booster2019 💜\nhttps://twitter.com/lisacrispin/status/1106754071233552384' + expected_content = '+1 \n---\nRT @lisacrispin@twitter.com\nThanks again to all the wonderful, welcoming people who made @boosterconf@twitter.com amazing. Umbrellas, great food, perfect mix of session types & lengths, great diversity, wide range of topics, so fun. #booster2019 💜\nhttps://twitter.com/lisacrispin/status/1106754071233552384' self.assertEqual(expected_content, tweet.clean_content) @@ -80,10 +80,10 @@ class TestTweets(unittest.TestCase): expected_content = """Say no to spec work. https://euronews.com/2019/04/15/fire-underway-at-notre-dame-cathedral-in-paris-firefighters-say Source: https://twitter.com/EPhilippePM/status/1118472220509126661 -cc @nospec +cc @nospec@twitter.com --- -RT @EPhilippePM -Faut-il reconstruire une flèche ? À l’identique ? Adaptée aux techniques et aux enjeux de notre époque ? Un concours international d’architecture portant sur la reconstruction de la flèche de la cathédrale sera organisé. #Not… +RT @EPhilippePM@twitter.com +Faut-il reconstruire une flèche ? À l’identique ? Adaptée aux techniques et aux enjeux de notre époque ? Un concours international d’architecture portant sur la reconstruction de la flèche de la cathéd… https://twitter.com/EPhilippePM/status/1118472220509126661""" self.assertEqual(expected_content, tweet.clean_content) -- GitLab