404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.137.143.141: ~ $
"""Tests for acme.errors."""
import unittest

import mock


class BadNonceTest(unittest.TestCase):
    """Tests for acme.errors.BadNonce."""

    def setUp(self):
        from acme.errors import BadNonce
        self.error = BadNonce(nonce="xxx", error="error")

    def test_str(self):
        self.assertEqual("Invalid nonce ('xxx'): error", str(self.error))


class MissingNonceTest(unittest.TestCase):
    """Tests for acme.errors.MissingNonce."""

    def setUp(self):
        from acme.errors import MissingNonce
        self.response = mock.MagicMock(headers={})
        self.response.request.method = 'FOO'
        self.error = MissingNonce(self.response)

    def test_str(self):
        self.assertTrue("FOO" in str(self.error))
        self.assertTrue("{}" in str(self.error))


class PollErrorTest(unittest.TestCase):
    """Tests for acme.errors.PollError."""

    def setUp(self):
        from acme.errors import PollError
        self.timeout = PollError(
            exhausted=set([mock.sentinel.AR]),
            updated={})
        self.invalid = PollError(exhausted=set(), updated={
            mock.sentinel.AR: mock.sentinel.AR2})

    def test_timeout(self):
        self.assertTrue(self.timeout.timeout)
        self.assertFalse(self.invalid.timeout)

    def test_repr(self):
        self.assertEqual('PollError(exhausted=%s, updated={sentinel.AR: '
                         'sentinel.AR2})' % repr(set()), repr(self.invalid))


if __name__ == "__main__":
    unittest.main()  # pragma: no cover

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 727 B 0644
challenges.py File 19.8 KB 0644
challenges_test.py File 21.17 KB 0644
client.py File 46.26 KB 0644
client_test.py File 56.84 KB 0644
crypto_util.py File 10.99 KB 0644
crypto_util_test.py File 9.98 KB 0644
errors.py File 3.57 KB 0644
errors_test.py File 1.48 KB 0644
fields.py File 1.7 KB 0644
fields_test.py File 2.03 KB 0644
jose_test.py File 1.92 KB 0644
jws.py File 2.09 KB 0644
jws_test.py File 2.03 KB 0644
magic_typing.py File 534 B 0644
magic_typing_test.py File 1.42 KB 0644
messages.py File 19.11 KB 0644
messages_test.py File 16.25 KB 0644
standalone.py File 11.09 KB 0644
standalone_test.py File 10.54 KB 0644
test_util.py File 3.12 KB 0644
util.py File 166 B 0644
util_test.py File 456 B 0644