mirror of https://gitee.com/a529548204/apitest.git
增加host参数化
This commit is contained in:
parent
facd86beb6
commit
38ce07d517
|
@ -18,8 +18,8 @@ Log()
|
|||
|
||||
class apiSend(object):
|
||||
|
||||
def __init__(self):
|
||||
self.host = host_manage(hos="${host}$")
|
||||
def __init__(self,host="host"):
|
||||
self.host = host_manage(hos="${{{}}}$".format(host))
|
||||
self.http_type = host_manage(hos="${http_type}$")
|
||||
|
||||
@staticmethod
|
||||
|
@ -222,5 +222,5 @@ class apiSend(object):
|
|||
|
||||
apisend = apiSend()
|
||||
if __name__ == '__main__':
|
||||
apisend.get()
|
||||
apisend()
|
||||
a = apiSend()
|
||||
print(a.host)
|
|
@ -91,4 +91,6 @@ if __name__ == '__main__':
|
|||
# print(db_manage("${database}$"))
|
||||
# print(db_manage("${charset}$"))
|
||||
# print(int(db_manage("${port}$")))
|
||||
print(dingding_manage("${webhook}$"))
|
||||
print(host_manage("${host}$"))
|
||||
print("${{{haha}}}$".format(**{"haha":"123"}))
|
||||
print(host_manage("${{{haha}}}$".format(**{"haha":"host2"})))
|
||||
|
|
|
@ -48,4 +48,4 @@ class Config(object):
|
|||
|
||||
if __name__ == '__main__':
|
||||
c = Config()
|
||||
print(c.read_db()["host"])
|
||||
print(c.read_host()["host"])
|
||||
|
|
Loading…
Reference in New Issue