def test():
    ''' swf_meta.py: Unit 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")

    # Generate the input data for this worker
    md5 = workbench.store_sample(open('../data/swf/unknown.swf', 'rb').read(), 'unknown.swf', 'swf')
    input_data = workbench.get_sample(md5)
    input_data.update(workbench.work_request('meta', md5))

    # Execute the worker
    worker = SWFMeta()
    output = worker.execute(input_data)
    print 'SWFMeta: '
    import pprint
    pprint.pprint(output)
def test ( ) : import zerorpc workbench = zerorpc . Client ( timeout = 300 , heartbeat = 60 ) workbench . connect ( "tcp://127.0.0.1:4242" ) md5 = workbench . store_sample ( open ( '../data/swf/unknown.swf' , 'rb' ) . read ( ) , 'unknown.swf' , 'swf' ) input_data = workbench . get_sample ( md5 ) input_data . update ( workbench . work_request ( 'meta' , md5 ) ) worker = SWFMeta ( ) output = worker . execute ( input_data ) print 'SWFMeta: ' import pprint pprint . pprint ( output )
swf_meta.py: Unit test