def setUp(self):
     from acme.challenges import RecoveryContact
     self.msg = RecoveryContact(
         activation_url='https://example.ca/sendrecovery/a5bd99383fb0',
         success_url='https://example.ca/confirmrecovery/bb1b9928932',
         contact='c********[email protected]')
     self.jmsg = {
         'type': 'recoveryContact',
         'activationURL': 'https://example.ca/sendrecovery/a5bd99383fb0',
         'successURL': 'https://example.ca/confirmrecovery/bb1b9928932',
         'contact': 'c********[email protected]',
     }
Esempio n. 2
0
    def test_json_without_optionals(self):
        del self.jmsg['activationURL']
        del self.jmsg['successURL']
        del self.jmsg['contact']

        from acme.challenges import RecoveryContact
        msg = RecoveryContact.from_json(self.jmsg)

        self.assertTrue(msg.activation_url is None)
        self.assertTrue(msg.success_url is None)
        self.assertTrue(msg.contact is None)
        self.assertEqual(self.jmsg, msg.to_partial_json())
Esempio n. 3
0
 def setUp(self):
     from acme.challenges import RecoveryContact
     self.msg = RecoveryContact(
         activation_url='https://example.ca/sendrecovery/a5bd99383fb0',
         success_url='https://example.ca/confirmrecovery/bb1b9928932',
         contact='c********[email protected]')
     self.jmsg = {
         'type': 'recoveryContact',
         'activationURL' : 'https://example.ca/sendrecovery/a5bd99383fb0',
         'successURL' : 'https://example.ca/confirmrecovery/bb1b9928932',
         'contact' : 'c********[email protected]',
     }
    def test_json_without_optionals(self):
        del self.jmsg['activationURL']
        del self.jmsg['successURL']
        del self.jmsg['contact']

        from acme.challenges import RecoveryContact
        msg = RecoveryContact.from_json(self.jmsg)

        self.assertTrue(msg.activation_url is None)
        self.assertTrue(msg.success_url is None)
        self.assertTrue(msg.contact is None)
        self.assertEqual(self.jmsg, msg.to_partial_json())
Esempio n. 5
0
    def setUp(self):
        from acme.challenges import RecoveryContact

        self.msg = RecoveryContact(
            activation_url="https://example.ca/sendrecovery/a5bd99383fb0",
            success_url="https://example.ca/confirmrecovery/bb1b9928932",
            contact="c********[email protected]",
        )
        self.jmsg = {
            "type": "recoveryContact",
            "activationURL": "https://example.ca/sendrecovery/a5bd99383fb0",
            "successURL": "https://example.ca/confirmrecovery/bb1b9928932",
            "contact": "c********[email protected]",
        }
Esempio n. 6
0
class RecoveryContactTest(unittest.TestCase):
    def setUp(self):
        from acme.challenges import RecoveryContact

        self.msg = RecoveryContact(
            activation_url="https://example.ca/sendrecovery/a5bd99383fb0",
            success_url="https://example.ca/confirmrecovery/bb1b9928932",
            contact="c********[email protected]",
        )
        self.jmsg = {
            "type": "recoveryContact",
            "activationURL": "https://example.ca/sendrecovery/a5bd99383fb0",
            "successURL": "https://example.ca/confirmrecovery/bb1b9928932",
            "contact": "c********[email protected]",
        }

    def test_to_partial_json(self):
        self.assertEqual(self.jmsg, self.msg.to_partial_json())

    def test_from_json(self):
        from acme.challenges import RecoveryContact

        self.assertEqual(self.msg, RecoveryContact.from_json(self.jmsg))

    def test_from_json_hashable(self):
        from acme.challenges import RecoveryContact

        hash(RecoveryContact.from_json(self.jmsg))

    def test_json_without_optionals(self):
        del self.jmsg["activationURL"]
        del self.jmsg["successURL"]
        del self.jmsg["contact"]

        from acme.challenges import RecoveryContact

        msg = RecoveryContact.from_json(self.jmsg)

        self.assertTrue(msg.activation_url is None)
        self.assertTrue(msg.success_url is None)
        self.assertTrue(msg.contact is None)
        self.assertEqual(self.jmsg, msg.to_partial_json())
Esempio n. 7
0
class RecoveryContactTest(unittest.TestCase):

    def setUp(self):
        from acme.challenges import RecoveryContact
        self.msg = RecoveryContact(
            activation_url='https://example.ca/sendrecovery/a5bd99383fb0',
            success_url='https://example.ca/confirmrecovery/bb1b9928932',
            contact='c********[email protected]')
        self.jmsg = {
            'type': 'recoveryContact',
            'activationURL' : 'https://example.ca/sendrecovery/a5bd99383fb0',
            'successURL' : 'https://example.ca/confirmrecovery/bb1b9928932',
            'contact' : 'c********[email protected]',
        }

    def test_to_partial_json(self):
        self.assertEqual(self.jmsg, self.msg.to_partial_json())

    def test_from_json(self):
        from acme.challenges import RecoveryContact
        self.assertEqual(self.msg, RecoveryContact.from_json(self.jmsg))

    def test_from_json_hashable(self):
        from acme.challenges import RecoveryContact
        hash(RecoveryContact.from_json(self.jmsg))

    def test_json_without_optionals(self):
        del self.jmsg['activationURL']
        del self.jmsg['successURL']
        del self.jmsg['contact']

        from acme.challenges import RecoveryContact
        msg = RecoveryContact.from_json(self.jmsg)

        self.assertTrue(msg.activation_url is None)
        self.assertTrue(msg.success_url is None)
        self.assertTrue(msg.contact is None)
        self.assertEqual(self.jmsg, msg.to_partial_json())
Esempio n. 8
0
class RecoveryContactTest(unittest.TestCase):

    def setUp(self):
        from acme.challenges import RecoveryContact
        self.msg = RecoveryContact(
            activation_url='https://example.ca/sendrecovery/a5bd99383fb0',
            success_url='https://example.ca/confirmrecovery/bb1b9928932',
            contact='c********[email protected]')
        self.jmsg = {
            'type': 'recoveryContact',
            'activationURL': 'https://example.ca/sendrecovery/a5bd99383fb0',
            'successURL': 'https://example.ca/confirmrecovery/bb1b9928932',
            'contact': 'c********[email protected]',
        }

    def test_to_partial_json(self):
        self.assertEqual(self.jmsg, self.msg.to_partial_json())

    def test_from_json(self):
        from acme.challenges import RecoveryContact
        self.assertEqual(self.msg, RecoveryContact.from_json(self.jmsg))

    def test_from_json_hashable(self):
        from acme.challenges import RecoveryContact
        hash(RecoveryContact.from_json(self.jmsg))

    def test_json_without_optionals(self):
        del self.jmsg['activationURL']
        del self.jmsg['successURL']
        del self.jmsg['contact']

        from acme.challenges import RecoveryContact
        msg = RecoveryContact.from_json(self.jmsg)

        self.assertTrue(msg.activation_url is None)
        self.assertTrue(msg.success_url is None)
        self.assertTrue(msg.contact is None)
        self.assertEqual(self.jmsg, msg.to_partial_json())
Esempio n. 9
0
 def test_from_json_hashable(self):
     from acme.challenges import RecoveryContact
     hash(RecoveryContact.from_json(self.jmsg))
Esempio n. 10
0
 def test_from_json(self):
     from acme.challenges import RecoveryContact
     self.assertEqual(self.msg, RecoveryContact.from_json(self.jmsg))
 def test_from_json_hashable(self):
     from acme.challenges import RecoveryContact
     hash(RecoveryContact.from_json(self.jmsg))
 def test_from_json(self):
     from acme.challenges import RecoveryContact
     self.assertEqual(self.msg, RecoveryContact.from_json(self.jmsg))