Просмотр исходного кода

Remove TargetAPIEncoding test workaround

- Not currently required in staging-client, which doesn't yet include inproxy
  branch.
- Workaround depends on symbols defined in inproxy branch.
Rod Hynes 1 год назад
Родитель
Сommit
be2427e798
1 измененных файлов с 2 добавлено и 30 удалено
  1. 2 30
      ClientLibrary/clientlib/clientlib_test.go

+ 2 - 30
ClientLibrary/clientlib/clientlib_test.go

@@ -56,7 +56,9 @@ func TestStartTunnel(t *testing.T) {
 	if err != nil {
 		t.Fatalf("json.Unmarshal failed: %v", err)
 	}
+
 	config["DisableRemoteServerListFetcher"] = true
+
 	configJSONNoFetcher, err := json.Marshal(config)
 	if err != nil {
 		t.Fatalf("json.Marshal failed: %v", err)
@@ -259,21 +261,6 @@ func TestMultipleStartTunnel(t *testing.T) {
 		t.Skipf("error loading configuration file: %s", err)
 	}
 
-	var config map[string]interface{}
-	err = json.Unmarshal(configJSON, &config)
-	if err != nil {
-		t.Fatalf("json.Unmarshal failed: %v", err)
-	}
-
-	// Use the legacy encoding to both exercise that case, and facilitate a
-	// gradual network upgrade to new encoding support.
-	config["TargetAPIEncoding"] = protocol.PSIPHON_API_ENCODING_JSON
-
-	configJSON, err = json.Marshal(config)
-	if err != nil {
-		t.Fatalf("json.Marshal failed: %v", err)
-	}
-
 	testDataDirName, err := os.MkdirTemp("", "psiphon-clientlib-test")
 	if err != nil {
 		t.Fatalf("ioutil.TempDir failed: %v", err)
@@ -333,21 +320,6 @@ func TestPsiphonTunnel_Dial(t *testing.T) {
 		t.Skipf("error loading configuration file: %s", err)
 	}
 
-	var config map[string]interface{}
-	err = json.Unmarshal(configJSON, &config)
-	if err != nil {
-		t.Fatalf("json.Unmarshal failed: %v", err)
-	}
-
-	// Use the legacy encoding to both exercise that case, and facilitate a
-	// gradual network upgrade to new encoding support.
-	config["TargetAPIEncoding"] = protocol.PSIPHON_API_ENCODING_JSON
-
-	configJSON, err = json.Marshal(config)
-	if err != nil {
-		t.Fatalf("json.Marshal failed: %v", err)
-	}
-
 	testDataDirName, err := os.MkdirTemp("", "psiphon-clientlib-test")
 	if err != nil {
 		t.Fatalf("ioutil.TempDir failed: %v", err)