Fix Strikebot number parsing bug (mixed separators accepted) strikebot-0.0.7
authorJakob Cornell <jakob+gpg@jcornell.net>
Sun, 20 Nov 2022 22:58:26 +0000 (16:58 -0600)
committerJakob Cornell <jakob+gpg@jcornell.net>
Sun, 20 Nov 2022 22:58:26 +0000 (16:58 -0600)
strikebot/setup.cfg
strikebot/src/strikebot/tests.py
strikebot/src/strikebot/updates.py

index b3efa426237b4a66414e7024ce5926dd1d5c540a..cdd2e66e0bb226142d7e147936b85927adb2f89b 100644 (file)
@@ -1,6 +1,6 @@
 [metadata]
 name = strikebot
-version = 0.0.6
+version = 0.0.7
 
 [options]
 package_dir =
index d081e12eecfc34a35623d552858a30c61d350c0c..966bca64c691e1b75c851d924d046aac83cb10f9 100644 (file)
@@ -49,6 +49,11 @@ class UpdateParsingTests(TestCase):
                self.assertIsNone(pu.number)
                self.assertTrue(pu.count_attempt)
 
+               # this update is marked non-deletable, but I'm not sure it should be
+               pu = parse_update(_build_payload("12,123123"), 12_123_123, "")
+               self.assertIsNone(pu.number)
+               self.assertTrue(pu.count_attempt)
+
        def test_html_handling(self):
                pu = parse_update(_build_payload("123<hr>,456"), None, "")
                self.assertEqual(pu.number, 123)
index 2ecf1d70289758468b81216e7e2e587fa3406429..01eb67b57d978be8456bbaf793b076839bd1ab53 100644 (file)
@@ -182,6 +182,7 @@ def _parse_from_lines(lines: list[str], curr_count: Optional[int], bot_user: str
                                        else:
                                                count_attempt = True
                                else:
+                                       number = None
                                        count_attempt = True
                                        deletable = False