|
@@ -12,24 +12,24 @@ else:
|
|
|
print("设备初始化失败"+str(response.json()))
|
|
|
exit()
|
|
|
|
|
|
-# # 笛卡尔积测试数据获取接口
|
|
|
-# data_url = f"{server_url}/api/sdk/data"
|
|
|
-# jamming_policies = [policy.value for policy in JammingPolicy] # 获取所有干扰策略
|
|
|
-# anti_jamming_policies = [policy.value for policy in AntiJammingPolicy] # 获取所有抗干扰策略
|
|
|
+# 笛卡尔积测试数据获取接口
|
|
|
+data_url = f"{server_url}/api/sdk/data"
|
|
|
+jamming_policies = [policy.value for policy in JammingPolicy] # 获取所有干扰策略
|
|
|
+anti_jamming_policies = [policy.value for policy in AntiJammingPolicy] # 获取所有抗干扰策略
|
|
|
|
|
|
-# # 生成笛卡尔积测试数据
|
|
|
-# test_data = []
|
|
|
-# for jamming_policy in jamming_policies:
|
|
|
-# for anti_jamming_policy in anti_jamming_policies:
|
|
|
-# test_data.append({"jamming_policy": jamming_policy, "anti_jamming_policy": anti_jamming_policy})
|
|
|
-# print("笛卡尔积测试数据:", test_data)
|
|
|
-# print("------------------------")
|
|
|
-# # 发送测试数据并获取结果
|
|
|
-# for data in test_data:
|
|
|
-# response = requests.post(data_url, json=data)
|
|
|
-# if response.status_code == 200 and response.json()["code"] == 200:
|
|
|
-# print(f"测试数据: {data}")
|
|
|
-# print(f"结果: {response.json()['data']}")
|
|
|
-# print("------------------------")
|
|
|
-# else:
|
|
|
-# print("失败:", response.json())
|
|
|
+# 生成笛卡尔积测试数据
|
|
|
+test_data = []
|
|
|
+for jamming_policy in jamming_policies:
|
|
|
+ for anti_jamming_policy in anti_jamming_policies:
|
|
|
+ test_data.append({"jamming_policy": jamming_policy, "anti_jamming_policy": anti_jamming_policy})
|
|
|
+print("笛卡尔积测试数据:", test_data)
|
|
|
+print("------------------------")
|
|
|
+# 发送测试数据并获取结果
|
|
|
+for data in test_data:
|
|
|
+ response = requests.post(data_url, json=data)
|
|
|
+ if response.status_code == 200 and response.json()["code"] == 200:
|
|
|
+ print(f"测试数据: {data}")
|
|
|
+ print(f"结果: {response.json()['data']}")
|
|
|
+ print("------------------------")
|
|
|
+ else:
|
|
|
+ print("失败:", response.json())
|