Releases: hautof/haf
Releases · hautof/haf
2.9.6
2.9.3
2.9.2
- support case reuse by other case
example of reuse case: using 1.1.test1.response.body.data.name
1, using <@begin@> <@end@>
to make haf find the tag
<@begin@>{'type':'int','case':'1.1.test1','property':{'1':'api_response','2':'body','3':'data','4':'name'}}<@end@>
2, type is the target type, case is the target case, property ordered by the number 1,2,3,4...., haf would find the target by the number
3, add dependent_var and dependent to the case
- add GET/POST/PUT to the console output of http-request
2.9.0
2.8.8
- fix one bug of urllib.urlopen 's request
- when using get method:
1, if u want to using data as url, just not using using_data
in kwargs
Util.http_request(request)
2, if u want to using data as get's body, using using_data
is nessary in http_request
Util.http_request(request, using_data=True)
2.8.7
2.8.4
2.8.2
2.8.0
2.7.7
- add pluginmanager
import itertools
import random
import pluggy
import json
import os
import sys
import argparse
from haf import hookspecs, lib
class PluginManager(object):
def __init__(self):
self.get_plugin_manager()
def add_options(self, sub_run_arg_program):
pm = self.pm
return pm.hook.add_option(parse = sub_run_arg_program)
def load_from_file(self, file_name):
pm = self.pm
inputs = pm.hook.load_from_file(file_name = file_name)
if isinstance(inputs, list):
return inputs[0]
elif isinstance(inputs, dict):
return inputs
def publish_to_sql(self, args, results):
pm = self.pm
publish_result = pm.hook.publish_to_sql(args=args, results=results)
return publish_result
def start_web_server(self, args, bus_client):
pm = self.pm
result = pm.hook.start_web_server(args=args, bus_client=bus_client)
return result
def get_plugin_manager(self):
self.pm = pluggy.PluginManager("haf")
self.pm.add_hookspecs(hookspecs)
self.pm.load_setuptools_entrypoints("haf")
self.pm.register(lib)
return self.pm
plugin_manager = PluginManager()
- add hookspecs support
import pluggy
hookspec = pluggy.HookspecMarker("haf")
@hookspec
def add_option(parse):
"""add option to parse
:param run args
:return: None
"""
@hookspec
def load_from_file(file_name):
"""add option to parse
:param run args
:return: file_name
"""
@hookspec
def publish_to_sql(args, results):
"""publish result to sql
:param publish : or not
:param result : publish result
:return : None
"""
@hookspec
def start_web_server(args, bus_client):
"""start web server
:param args:
:return:
"""
- update sqlpublish and apiserver to new plugin mode