aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2021-08-07 10:57:24 -0700
committerGravatar MarkKoz <[email protected]>2021-08-07 10:57:24 -0700
commit1af466753975b70effd5e600d0afc8b21f272dd0 (patch)
tree5f06c423e211b06d0b0bf5f5aabf9649872dfb8f /tests
parentFix create_user_embed tests (diff)
Time: return strings from until_expiration instead of ambiguous None
None was returned for two separate cases: permanent infractions and expired infractions. This resulted in an ambiguity.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/utils/test_time.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/bot/utils/test_time.py b/tests/bot/utils/test_time.py
index e235f9b70..120d65176 100644
--- a/tests/bot/utils/test_time.py
+++ b/tests/bot/utils/test_time.py
@@ -100,8 +100,8 @@ class TimeTests(unittest.TestCase):
self.assertEqual(time.format_with_duration(expiry, date_from, max_units), expected)
def test_until_expiration_with_duration_none_expiry(self):
- """until_expiration should work for None expiry."""
- self.assertEqual(time.until_expiration(None), None)
+ """until_expiration should return "Permanent" is expiry is None."""
+ self.assertEqual(time.until_expiration(None), "Permanent")
def test_until_expiration_with_duration_custom_units(self):
"""until_expiration should work for custom max_units."""
@@ -122,7 +122,6 @@ class TimeTests(unittest.TestCase):
('3000-12-12T00:00:00Z', '<t:32533488000:R>'),
('3000-11-23T20:09:00Z', '<t:32531918940:R>'),
('3000-11-23T20:09:00Z', '<t:32531918940:R>'),
- (None, None),
)
for expiry, expected in test_cases: