def test_is_match_with_unmatching_handshake_type(self): exp = ExpectCertificate() msg = Message(ContentType.handshake, bytearray([HandshakeType.client_hello])) self.assertFalse(exp.is_match(msg))
def test_is_match_with_unmatching_content_type(self): exp = ExpectCertificate() msg = Message(ContentType.application_data, bytearray([HandshakeType.certificate])) self.assertFalse(exp.is_match(msg))
def test_is_match(self): exp = ExpectCertificate() msg = Message(ContentType.handshake, bytearray([HandshakeType.certificate])) self.assertTrue(exp.is_match(msg))