Skip to content

Commit

Permalink
Add test case for issue #224
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 committed Oct 18, 2024
1 parent 8c06e57 commit 200efa1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,18 @@ def test_matching_filters(self):
self.assertTrue(task.matches_filters([{"A": "a", "B": "b"}]))
self.assertFalse(task.matches_filters([{"Z": "a"}]))
self.assertFalse(task.matches_filters([{"A": "a", "Z": "a"}]))


class TestTaskLargeNumber(unittest.TestCase):
def test_large_number(self):
# Case from https://github.com/CERT-Polska/karton/issues/224
huge_n = 16500472521988697010663112438705807640072764589479002554256260695717317064262484691290598356970646828426660349407212809681822203919126081272297252018228030950728477136113932493730960235450313211028445802933417736042246471737169968152424614291341808025585752848637795661794780420312612645575283548111399362423653839834760368929525863676430601132093478720051122016787902563729760403548823660511230280753799912283221065068155277355752466002679387284450151073598015621110653783630539129630982849849675891985711599794713831157549822527748863844615219682824485519877354977586980738215172053213147055330238573803265248619061
task = Task(
headers={},
payload={
"e": 65537,
"n": huge_n,
}
)
task = Task.unserialize(task.serialize(), parse_resources=False)
self.assertTrue(task.payload["n"] == huge_n)

0 comments on commit 200efa1

Please sign in to comment.