def test():

    # This worker test requires a local server running
    workbench = zerorpc.Client(timeout=300, heartbeat=60)
    workbench.connect("tcp://127.0.0.1:4242")

    # Generate input for the worker
    data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                             '../data/pe/bad/033d91aae8ad29ed9fbb858179271232')
    md5 = workbench.store_sample(open(data_path, 'rb').read(), 'bad_pe', 'exe')
    input_data = workbench.work_request('meta_deep', md5)

    # Execute the worker (unit test)
    worker = PEDeepSim()
    output = worker.execute(input_data)
    print '\n<<< Unit Test >>>'
    pprint.pprint(output)

    # Execute the worker (server test)
    output = workbench.work_request('pe_deep_sim', md5)
    print '\n<<< Server Test >>>'
    pprint.pprint(output)
pe_deep_sim.py: Unit test
dataset/ETHPy150Open SuperCowPowers/workbench/workbench/workers/pe_deep_sim.py/test