コード例 #1
0
class ICanHazAsciiExtensionTestCase(TestCase):
    def setUp(self):
        self.ascii = ICanHazAsciiExtension(mock_bot())

    def test_is_flooded(self):
        self.ascii.last_used = {'foo': time.time()}
        assert self.ascii.is_flooded('foo')

    def test_is_flooded_not_recorded(self):
        self.ascii.last_used = {}
        assert not self.ascii.is_flooded('foo')

    def test_is_flooded_not_flooded(self):
        self.ascii.last_used = {'foo': time.time() - 86400}
        assert not self.ascii.is_flooded('foo')
コード例 #2
0
ファイル: test_icanhazascii.py プロジェクト: ZephyrXero/helga
class ICanHazAsciiExtensionTestCase(TestCase):

    def setUp(self):
        self.ascii = ICanHazAsciiExtension(mock_bot())

    def test_is_flooded(self):
        self.ascii.last_used = {'foo': time.time()}
        assert self.ascii.is_flooded('foo')

    def test_is_flooded_not_recorded(self):
        self.ascii.last_used = {}
        assert not self.ascii.is_flooded('foo')

    def test_is_flooded_not_flooded(self):
        self.ascii.last_used = {'foo': time.time() - 86400}
        assert not self.ascii.is_flooded('foo')
コード例 #3
0
ファイル: test_icanhazascii.py プロジェクト: ZephyrXero/helga
 def setUp(self):
     self.ascii = ICanHazAsciiExtension(mock_bot())
コード例 #4
0
 def setUp(self):
     self.ascii = ICanHazAsciiExtension(mock_bot())