def test_process(self): exp = ExpectApplicationData() state = ConnectionState() msg = Message(ContentType.application_data, bytearray(0)) exp.process(state, msg)
def test_process_with_non_matching_data(self): exp = ExpectApplicationData(bytearray(b"hello")) state = ConnectionState() msg = Message(ContentType.application_data, bytearray(b"bye")) self.assertTrue(exp.is_match(msg)) with self.assertRaises(AssertionError): exp.process(state, msg)