<s> import logging <EOL> from logging import StreamHandler <EOL> import sys <EOL> import unittest <EOL> import time <EOL> import zmq <EOL> from zmq . eventloop . ioloop import IOLoop <EOL> from zmq . eventloop . zmqstream import ZMQStream <EOL> from spyder . core . constants import CURI_OPTIONAL_TRUE <EOL> from spyder . core . constants import CURI_EXTRACTION_FINISHED <EOL> from spyder . core . constants import ZMQ_SPYDER_MGMT_WORKER <EOL> from spyder . core . settings import Settings <EOL> from spyder . core . worker import AsyncZmqWorker <EOL> from spyder import workerprocess <EOL> from spyder . processor . fetcher import FetchProcessor <EOL> class WorkerExtractorTestCase ( unittest . TestCase ) : <EOL> def test_that_creating_fetcher_works ( self ) : <EOL> ctx = zmq . Context ( ) <EOL> io_loop = IOLoop . instance ( ) <EOL> def stop_looping ( _msg ) : <EOL> io_loop . stop ( ) <EOL> settings = Settings ( ) <EOL> master_push = ctx . socket ( zmq . PUSH ) <EOL> master_push . bind ( settings . ZEROMQ_MASTER_PUSH ) <EOL> fetcher = workerprocess . create_worker_fetcher ( settings , { } , ctx , <EOL> StreamHandler ( sys . stdout ) , io_loop ) <EOL> self . assertTrue ( isinstance ( fetcher . _processing , FetchProcessor ) ) <EOL> self . assertTrue ( isinstance ( fetcher , AsyncZmqWorker ) ) <EOL> fetcher . _insocket . close ( ) <EOL> fetcher . _outsocket . close ( ) <EOL> master_push . close ( ) <EOL> ctx . term ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
