File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,14 @@ func TestGetApplicationEnvironments(t *testing.T) {
2828 config .ControlPlaneUrl = mockServer .URL
2929 defer func () { config .ControlPlaneUrl = originalURL }()
3030
31+ // 设置测试数据
32+ labels := map [string ]string {
33+ config .ServiceSpaceLabel : "test-namespace" ,
34+ config .ApplicationLabel : "test-application" ,
35+ }
36+
3137 // 调用被测试函数
32- data , err := GetApplicationEnvironments ("test-namespace" , "test-application" )
38+ data , err := GetApplicationEnvironments (labels )
3339
3440 // 验证结果
3541 assert .NoError (t , err )
@@ -42,8 +48,14 @@ func TestGetApplicationEnvironments(t *testing.T) {
4248func TestGetApplicationEnvironments2 (t * testing.T ) {
4349 config .ControlPlaneUrl = "http://localhost:8000/v1"
4450
51+ // 设置测试数据
52+ labels := map [string ]string {
53+ config .ServiceSpaceLabel : "test-namespace" ,
54+ config .ApplicationLabel : "test-application" ,
55+ }
56+
4557 // 调用被测试函数
46- data , err := GetApplicationEnvironments ("default1" , "showcase-agent-a1" )
58+ data , err := GetApplicationEnvironments (labels )
4759
4860 // 验证结果
4961 assert .NoError (t , err )
You can’t perform that action at this time.
0 commit comments