def test():

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

    # Test a file with known yara sigs
    filename = '../data/pe/bad/auriga.exe'

    with open(filename,'rb') as pe_file:
        base_name = os.path.basename(filename)
        md5 = workbench.store_sample(pe_file.read(), base_name, 'exe')

    # Grab the sample from workbench
    input_data = workbench.get_sample(md5)


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

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