示例#1
0
    def test_get_longest_ban_multi_bans(self):
        short_ban = tutils.ban_user(self.lanny, duration='1m')
        long_ban = tutils.ban_user(self.lanny, duration='2m')
        mid_ban = tutils.ban_user(self.lanny, duration='1m 5s')

        self.assertEqual(self.lanny.get_longest_ban(), long_ban)
示例#2
0
    def test_get_longest_ban_infinite(self):
        short_ban = tutils.ban_user(self.lanny, duration='1m')
        inf_ban = tutils.ban_user(self.lanny, duration=None)

        self.assertEqual(self.lanny.get_longest_ban(), inf_ban)
示例#3
0
    def test_get_ban_reason(self):
        tutils.ban_user(self.lanny, reason='bad reason', duration='1m')
        tutils.ban_user(self.lanny, reason='good reason', duration='2m')
        tutils.ban_user(self.lanny, reason='shit reason', duration='1m 5s')

        self.assertEqual(self.lanny.get_ban_reason(), 'good reason')
示例#4
0
 def test_is_banned_expired(self):
     tutils.ban_user(self.lanny, start_expired=True)
     self.assertFalse(self.lanny.is_banned())
示例#5
0
 def test_is_banned_infinite(self):
     tutils.ban_user(self.lanny, duration=None)
     self.assertTrue(self.lanny.is_banned())
示例#6
0
 def test_is_banned_positive(self):
     tutils.ban_user(self.lanny)
     self.assertTrue(self.lanny.is_banned())
示例#7
0
 def test_get_user_title_inf_ban(self):
     tutils.ban_user(self.lanny, duration='1m')
     self.assertEqual(self.lanny.get_user_title(), 'Novice (banned)')