数据驱动方式尝试
This commit is contained in:
BIN
05-Other/variable/__pycache__/my.cpython-36.pyc
Normal file
BIN
05-Other/variable/__pycache__/my.cpython-36.pyc
Normal file
Binary file not shown.
BIN
05-Other/variable/__pycache__/my2.cpython-36.pyc
Normal file
BIN
05-Other/variable/__pycache__/my2.cpython-36.pyc
Normal file
Binary file not shown.
BIN
05-Other/variable/__pycache__/my3.cpython-36.pyc
Normal file
BIN
05-Other/variable/__pycache__/my3.cpython-36.pyc
Normal file
Binary file not shown.
8
05-Other/variable/my.py
Normal file
8
05-Other/variable/my.py
Normal file
@@ -0,0 +1,8 @@
|
||||
MY_VAR = 'my value'
|
||||
my_name='test'
|
||||
VARIABLE = "An example string"
|
||||
ANOTHER_VARIABLE = "This is pretty easy!"
|
||||
INTEGER = 42
|
||||
STRINGS = ["one", "two", "kolme", "four"]
|
||||
NUMBERS = [1, INTEGER, 3.14]
|
||||
MAPPING = {"one": 1, "two": 2, "three": 3}
|
||||
11
05-Other/variable/my1.py
Normal file
11
05-Other/variable/my1.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import os
|
||||
import radom
|
||||
import time
|
||||
|
||||
USER = os.getlogin()
|
||||
RANDOM_INT = random.randint(1,10)
|
||||
CURRENT_TIME = time.asctime()
|
||||
if time.localtime()[3] > 12:
|
||||
AFTERNOON = True
|
||||
else
|
||||
AFTERNOON = False
|
||||
11
05-Other/variable/my2.py
Normal file
11
05-Other/variable/my2.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import math
|
||||
|
||||
_all_ = ['AREA1','AREA2']
|
||||
def get_area(diameter):
|
||||
radius = diameter/2
|
||||
area = math.pi*radius*radius
|
||||
return area
|
||||
|
||||
AREA1 = get_area(1)
|
||||
AREA2 = get_area(2)
|
||||
|
||||
10
05-Other/variable/my3.py
Normal file
10
05-Other/variable/my3.py
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
def get_variables1():
|
||||
variables = {"VARIABLE":"An example string",
|
||||
"ANOTHER VARIABLE":"This is pretty easy!",
|
||||
"INTEGER":66,
|
||||
"STRINGS":["one","two","kolme","four"],
|
||||
"NUMBERS":[1,66,3.1415926],
|
||||
"MAPPING":'{"one":1,"two":2,"three":3}',
|
||||
"DXY":'{"one":1,"two":2,"three":${VARIABLE}}'}
|
||||
return variables
|
||||
9
05-Other/variable/policy/apipolicyrequesttest.py
Normal file
9
05-Other/variable/policy/apipolicyrequesttest.py
Normal file
@@ -0,0 +1,9 @@
|
||||
def get_variables():
|
||||
variables = {"IP_OBJ":'{"opAction":"add","refuseCode":true,"returnData":1,"objectList":{"objectType":"ip","objectSubType":"endpoint","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"autotest","objectDesc":"autotest","subObjectIds":[],"addItemList":[{"ip":"192.168.32.69","ipIf":false,"portIf":false,"port":"1-65535","itemId":"","clientIp1":"192.168.32.69","clientIp2":"192.168.32.69","clientPort1":"1","clientPort2":"65535","clientIpFormat":"range","clientPortFormat":"range","addrType":4,"direction":0,"temporaryItemId":1606647164},{"ip":"1.1.1.1","ipIf":false,"portIf":false,"port":"0-65535","itemId":"","clientIp1":"1.1.1.1","clientIp2":"1.1.1.1","clientPort1":"","clientPort2":"","clientIpFormat":"range","clientPortFormat":"range","addrType":4,"direction":0,"temporaryItemId":1606647177}],"updateItemList":[],"deleteItemIds":[],"iconColor":"#31739C"}}',
|
||||
"FQDN_OBJ":'"{"opAction":"add","returnData":1,"objectList":{"objectType":"fqdn","objectSubType":"fqdn","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"autotest","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$www.test.com"],"t":1606647302921,"itemId":"","isHexbin":0,"state":2},{"keywordArray":["*autotest.com"],"t":1606647302921,"isHexbin":0,"state":2}],"updateItemList":[],"deleteItemIds":[],"objectId":""}}"',
|
||||
"SECURITY_POLICY":'{"opAction":"add","refuseCode":true,"policyList":{"policyId":"","policyName":"autotest","policyType":"tsg_security","action":"intercept","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"dxytest","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":1,"mirror_profile":25}},"source":[{"objectId":IP_OBJ,"protocolField":"TSG_SECURITY_SOURCE_ADDR"}],"destination":[{"objectId":IP_OBJ,"protocolField":"TSG_SECURITY_DESTINATION_ADDR"}],"filterList":[{"filter":[{"objectId":FQDN_OBJ,"protocolField":"TSG_FIELD_SSL_SNI"}]}],"appIdObjects":[44],"appSelectorObjects":[],"isValid":1,"scheduleId":[]}}',
|
||||
"STRINGS":["one","two","kolme","four"],
|
||||
"NUMBERS":[1,66,3.1415926],
|
||||
"MAPPING":'{"one":1,"two":2,"three":3}',
|
||||
"DXY":'{"one":1,"two":2,"three":${VARIABLE}}'}
|
||||
return variables
|
||||
Reference in New Issue
Block a user