From 3aa2e378e3d184c3408ee89b0e08c6fb731ff4a5 Mon Sep 17 00:00:00 2001 From: Justin Warren Date: Sun, 15 Jan 2023 10:02:12 +1100 Subject: [PATCH] Remove implied setting of reject_media/reports if severity is set to 'suspend'. Complicates understanding of what the code actually does. --- src/fediblockhole/const.py | 8 -------- tests/test_domainblock.py | 9 --------- 2 files changed, 17 deletions(-) diff --git a/src/fediblockhole/const.py b/src/fediblockhole/const.py index b67959b..93cf2ef 100644 --- a/src/fediblockhole/const.py +++ b/src/fediblockhole/const.py @@ -127,8 +127,6 @@ class DomainBlock(object): """Initialize the DomainBlock """ self.domain = domain - # Set severity first so if reject_media or reject_reports = False - # that overrides the default of True for severity = 'suspend' self.severity = severity self.public_comment = public_comment self.private_comment = private_comment @@ -148,12 +146,6 @@ class DomainBlock(object): else: self._severity = BlockSeverity(sev) - # Suspend implies reject_media,reject_reports == True - log.debug('Suspend blocks media and reports') - if self._severity.level == SeverityLevel.SUSPEND: - self.reject_media = True - self.reject_reports = True - def _asdict(self): """Return a dict version of this object """ diff --git a/tests/test_domainblock.py b/tests/test_domainblock.py index 783fcd8..2db0b51 100644 --- a/tests/test_domainblock.py +++ b/tests/test_domainblock.py @@ -72,12 +72,3 @@ def test_compare_diff_sevs_2(): b = DomainBlock('example1.org', 'noop') assert a != b - -def test_suspend_rejects(): - """A suspend should reject_media and reject_reports - """ - a = DomainBlock('example.org', 'suspend') - - assert a.severity.level == SeverityLevel.SUSPEND - assert a.reject_media == True - assert a.reject_reports == True \ No newline at end of file