class TestNoProtocol(TestCase): def setUp(self): self.byte_string = b"Hello World!" self._no_prot = NoProtocol(self.byte_string) def test_get_bytes(self): self.assertEqual(self._no_prot.get_bytes(), self.byte_string) def test_to_str(self): my_string = str(self.byte_string) self.assertEqual(self._no_prot.__str__(), my_string) def tearDown(self): pass
def _receive(self): received_bytes = self._read_until_empty(self._proxy_socket) return NoProtocol(received_bytes)
def setUp(self): self.byte_string = b"Hello World!" self._no_prot = NoProtocol(self.byte_string)
def test_send_error(self): with self.assertRaises(ProxyError): self._proxy.send(NoProtocol(b"Hello World!"))