MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / test_resource_get_node_data

Function test_resource_get_node_data

test/python/pipeline_test.py:98–115  ·  view source on GitHub ↗

测试 Resource.get_node_data 返回原始 JSON dict

(resource: Resource)

Source from the content-addressed store, hash-verified

96
97
98def test_resource_get_node_data(resource: Resource):
99 """测试 Resource.get_node_data 返回原始 JSON dict"""
100 print("\n=== test_resource_get_node_data ===")
101
102 # 测试存在的节点
103 node_data = resource.get_node_data("TestBasic")
104 assert_not_none(node_data, "TestBasic node_data")
105 assert_true(isinstance(node_data, dict), "node_data should be dict")
106
107 # 检查基本字段存在
108 assert_true("recognition" in node_data, "recognition field")
109 assert_true("action" in node_data, "action field")
110
111 # 测试不存在的节点
112 non_exist = resource.get_node_data("NonExistentNode12345")
113 assert_eq(non_exist, None, "non-existent node should return None")
114
115 print(" PASS: resource.get_node_data")
116
117
118def test_resource_get_node_object(resource: Resource):

Callers 1

pipeline_node_testFunction · 0.85

Calls 4

assert_not_noneFunction · 0.85
assert_trueFunction · 0.85
assert_eqFunction · 0.85
get_node_dataMethod · 0.45

Tested by

no test coverage detected