def test_empty_getresponse(self): entry = MocketEntry(('localhost', 8080), []) self.assertEqual(entry.get_response(), encode_to_bytes(''))
def test_getresponse(self): entry = MocketEntry(('localhost', 8080), ['Show me.\r\n']) self.assertEqual(entry.get_response(), encode_to_bytes('Show me.\r\n'))
def test_raise_exception(self): entry = MocketEntry(("localhost", 8080), [IOError()]) with self.assertRaises(IOError): entry.get_response()
def test_getresponse(self): entry = MocketEntry(("localhost", 8080), ["Show me.\r\n"]) self.assertEqual(entry.get_response(), encode_to_bytes("Show me.\r\n"))
def test_empty_getresponse(self): entry = MocketEntry(('localhost', 8080), []) self.assertEqual(entry.get_response(), encode_to_bytes(''))
def test_getresponse(self): entry = MocketEntry(('localhost', 8080), ['Show me.\r\n']) self.assertEqual(entry.get_response(), encode_to_bytes('Show me.\r\n'))