Skip to content

Commit

Permalink
Remove TargetAPIEncoding test workaround
Browse files Browse the repository at this point in the history
- Not currently required in staging-client, which doesn't yet include inproxy
  branch.
- Workaround depends on symbols defined in inproxy branch.
  • Loading branch information
rod-hynes committed Jun 14, 2024
1 parent ba6e7df commit be2427e
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions ClientLibrary/clientlib/clientlib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit be2427e

Please sign in to comment.