Пример #1
0
 def test_empty_getresponse(self):
     entry = MocketEntry(('localhost', 8080), [])
     self.assertEqual(entry.get_response(), encode_to_bytes(''))
Пример #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'))
Пример #3
0
    def test_raise_exception(self):
        entry = MocketEntry(("localhost", 8080), [IOError()])

        with self.assertRaises(IOError):
            entry.get_response()
Пример #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"))
Пример #5
0
 def test_empty_getresponse(self):
     entry = MocketEntry(('localhost', 8080), [])
     self.assertEqual(entry.get_response(), encode_to_bytes(''))
Пример #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'))