You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
512 B
23 lines
512 B
import socket
|
|
|
|
from gevent.testing import util
|
|
from gevent.testing import main
|
|
|
|
|
|
class Test(util.TestServer):
|
|
server = 'udp_server.py'
|
|
|
|
def _run_all_tests(self):
|
|
sock = socket.socket(type=socket.SOCK_DGRAM)
|
|
try:
|
|
sock.connect(('127.0.0.1', 9000))
|
|
sock.send(b'Test udp_server')
|
|
data, _address = sock.recvfrom(8192)
|
|
self.assertEqual(data, b'Received 15 bytes')
|
|
finally:
|
|
sock.close()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|