Exemplo n.º 1
0
 def test_empty_getresponse(self):
     entry = MocketEntry(('localhost', 8080), [])
     self.assertEqual(entry.get_response(), encode_to_bytes(''))
Exemplo n.º 2
0
 def test_getresponse(self):
     entry = MocketEntry(('localhost', 8080), ['Show me.\r\n'])
     self.assertEqual(entry.get_response(), encode_to_bytes('Show me.\r\n'))
Exemplo n.º 3
0
    def test_raise_exception(self):
        entry = MocketEntry(("localhost", 8080), [IOError()])

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