예제 #1
0
    print("Production get_reports")
    start_time = _default_timer()
    result = get_reports()

    print("{} entries found.".format(len(result)))
    _pprint(_Auxiliary._guess_schema(result))

    print("Time taken: {}".format(_default_timer() - start_time))
    # Test test
    print("Test get_reports")
    start_time = _default_timer()
    result = get_reports(test=True)

    print("{} entries found.".format(len(result)))
    _pprint(_Auxiliary._guess_schema(result))

    print("Time taken: {}".format(_default_timer() - start_time))


if __name__ == '__main__':
    from optparse import OptionParser as _OptionParser
    _parser = _OptionParser()
    _parser.add_option("-t",
                       "--test",
                       action="store_true",
                       default=False,
                       help="Execute the interfaces to test them.")
    (_options, _args) = _parser.parse_args()

    if _options.test:
        _test_interfaces()
예제 #2
0
    print("{} entries found.".format(len(result)))
    _pprint(_Auxiliary._guess_schema(result))
    
    print("Time taken: {}".format(_default_timer() - start_time))
    
    # Production test
    print("Production get_script_by_title")
    start_time = _default_timer()
    result = get_script_by_title("the princess bride")
    
    _pprint(result)
    
    print("Time taken: {}".format(_default_timer() - start_time))
    

if __name__ == '__main__':
    from optparse import OptionParser as _OptionParser
    _parser = _OptionParser()
    _parser.add_option("-t", "--test", action="store_true",
                      default=False,
                      help="Execute the interfaces to test them.")
    _parser.add_option("-r", "--reset", action="store_true",
                      default=False,
                      help="Reset the cache")
    (_options, _args) = _parser.parse_args()
    
    if _options.test:
        _test_interfaces()

    if _options.reset:
        _modify_self()