Example #1
0
    def _test_write(self, stream, certificate_type, certificate_value):
        certificate = Certificate(certificate_type=certificate_type,
                                  certificate_value=certificate_value)

        expected = stream
        observed = BytearrayStream()

        certificate.write(observed)

        msg = "encoding mismatch;\nexpected:\n{0}\nobserved:\n{1}".format(
            expected, observed)
        self.assertEqual(expected, observed, msg)
Example #2
0
    def _test_write(self, stream, certificate_type, certificate_value):
        certificate = Certificate(
            certificate_type=certificate_type,
            certificate_value=certificate_value)

        expected = stream
        observed = BytearrayStream()

        certificate.write(observed)

        msg = "encoding mismatch;\nexpected:\n{0}\nobserved:\n{1}".format(
            expected, observed)
        self.assertEqual(expected, observed, msg)