Example #1
0
    def test_serialize_signup_info(self):
        signup_info = \
            EnclaveSignupInfo(
                poet_public_key='My Fake Key',
                proof_data='I am Victoria Antoinette Scharleau, and I '
                           'approve of this message.',
                anti_sybil_id='Sally Field',
                sealed_signup_data="Signed, Sealed, Delivered, I'm Yours")

        self.assertIsNotNone(signup_info.serialize())
    def test_serialize_signup_info(self):
        signup_info = \
            EnclaveSignupInfo(
                poet_public_key='My Fake Key',
                proof_data='I am Victoria Antoinette Scharleau, and I '
                           'approve of this message.',
                anti_sybil_id='Sally Field',
                sealed_signup_data="Signed, Sealed, Delivered, I'm Yours")

        self.assertIsNotNone(signup_info.serialize())
Example #3
0
def test_deserialized_signup_info(benchmark):

    signup_info = \
        EnclaveSignupInfo(
            poet_public_key='My Fake Key',
            proof_data='I am Victoria Antoinette Scharleau, and I '
                       'approve of this message.',
            anti_sybil_id='Sally Field',
            sealed_signup_data="Signed, Sealed, Delivered, I'm Yours")
    serialized = signup_info.serialize()
    copy_signup_info = benchmark(EnclaveSignupInfo.signup_info_from_serialized,
                                 serialized)
    assert signup_info.poet_public_key == copy_signup_info.poet_public_key
Example #4
0
    def test_deserialized_signup_info(self):
        signup_info = \
            EnclaveSignupInfo(
                poet_public_key='My Fake Key',
                proof_data='I am Victoria Antoinette Scharleau, and I '
                           'approve of this message.',
                anti_sybil_id='Sally Field',
                sealed_signup_data="Signed, Sealed, Delivered, I'm Yours")
        serialized = signup_info.serialize()
        copy_signup_info = \
            EnclaveSignupInfo.signup_info_from_serialized(serialized)

        self.assertEqual(signup_info.poet_public_key,
                         copy_signup_info.poet_public_key)
        self.assertEqual(signup_info.proof_data, copy_signup_info.proof_data)
        self.assertEqual(signup_info.anti_sybil_id,
                         copy_signup_info.anti_sybil_id)
        self.assertIsNone(copy_signup_info.sealed_signup_data)
        self.assertEqual(serialized, copy_signup_info.serialize())
    def test_deserialized_signup_info(self):
        signup_info = \
            EnclaveSignupInfo(
                poet_public_key='My Fake Key',
                proof_data='I am Victoria Antoinette Scharleau, and I '
                           'approve of this message.',
                anti_sybil_id='Sally Field',
                sealed_signup_data="Signed, Sealed, Delivered, I'm Yours")
        serialized = signup_info.serialize()
        copy_signup_info = \
            EnclaveSignupInfo.signup_info_from_serialized(serialized)

        self.assertEqual(
            signup_info.poet_public_key,
            copy_signup_info.poet_public_key)
        self.assertEqual(signup_info.proof_data, copy_signup_info.proof_data)
        self.assertEqual(
            signup_info.anti_sybil_id,
            copy_signup_info.anti_sybil_id)
        self.assertIsNone(copy_signup_info.sealed_signup_data)
        self.assertEqual(serialized, copy_signup_info.serialize())