func TestParseScutildata_Read_HTTPS(t *testing.T) {
	a := assert.New(t)
	c := newDarwinTestProvider()
	commands := getDarwinProviderTestsNoBypass(ScutilDataHttps)
	targetUrl := ParseTargetURL("", "")
	protocols := [4]string{"http", "https", "HTTP", "HTTPS"}
	for _, protocol := range protocols {
		for _, command := range commands {
			expectedProxy, err := c.parseScutildata(protocol, targetUrl, "echo", command)
			if strings.ToLower(protocol) == "https" {
				a.Nil(err)
				a.NotNil(expectedProxy)
				a.Equal(&proxy{src: "State:/Network/Global/Proxies", host: "1.2.3.4", port: 1234},
					expectedProxy)
			} else {
				a.Nil(expectedProxy)
				a.Equal(isNotFound(err), true)
			}
		}
	}
}
/*
Below tests cover cases when only https proxy is present.
following tests are being performed:
- Test https proxy is not nil,
- Test http proxy is nil,
- Test https proxy match expected,
- Test for lower case and upper case, i.e. https/HTTPS/...,
- Test no errors are returned
package proxy
import (
	"context"
	"fmt"
	"github.com/stretchr/testify/assert"
	"os/exec"
	"strings"
	"testing"
)
const (
	ScutilDataHttpsHttp = "ScutilDataHttpsHttp"
	ScutilDataHttps     = "ScutilDataHttps"
	ScutilDataHttp      = "ScutilDataHttp"
)
const (
	ScutilBypassTest1 = "localhost"
	ScutilBypassTest2 = "myorg1.com"
	ScutilBypassTest3 = "endpoint.myorg2.com"
	ScutilBypassTest4 = ".myorg3.com"
	ScutilBypassTest5 = "*.myorg4.com"
	ScutilBypassTest6 = "test.endpoint.myorg5.com"
	ScutilBypassTest7 = "test.test.*.*.com"
)
var providerDarwinTestCasesNoBypass = []struct {
	testType string
	test     string
}{
	{ScutilDataHttpsHttp,
		"<dictionary> {\n  HTTPSEnable : 1\n HTTPSPort : 1234\n  HTTPSProxy : 1.2.3.4\n HTTPEnable : 1\n  " +
			"HTTPPort : 1234\n  HTTPProxy : 1.2.3.4\n}"},
	{ScutilDataHttpsHttp,
		"         <dictionary> {   \n  HTTPSEnable:1    \nHTTPSPort :  1234\n  HTTPSProxy :  1.2.3.4\n " +
			"HTTPEnable : 1   \n  HTTPPort :      1234\nHTTPProxy: 1.2.3.4   \n    }"},
	{ScutilDataHttps,
		"<dictionary> {\n  HTTPEnable : 0\n  HTTPSEnable : 1\n  HTTPSPort : 1234\n  HTTPSProxy : 1.2.3.4\n}"},
	{ScutilDataHttps,
		"<dictionary> {\n   HTTPEnable: 0\n  HTTPSEnable: 1\nHTTPSPort :      1234\n     HTTPSProxy:   1.2.3.4\n}"},
	{ScutilDataHttp,
		"<dictionary> {\n  HTTPSEnable : 0\n  HTTPEnable : 1\n  HTTPPort : 1234\n  HTTPProxy : 1.2.3.4\n}"},
	{ScutilDataHttp,
		"<dictionary> {\n     HTTPSEnable:0\n  HTTPEnable: 1\nHTTPPort :       1234\n     HTTPProxy:   1.2.3.4\n}"},
}
var bypassProxySettingsHostsDomains = map[string][]map[string]bool{
	ScutilBypassTest1: {  
		{"localhost": true},
		{"localhost:1234": true},
		{"localhost:8080": true},
		{"http://localhost:8080": true},
		{"local": false},
	},
	ScutilBypassTest2: {
		{"myorg1.com": true},
		{"myorg1.com:443": true},
		{"www.myorg1.com": true},
		{"https://myorg1.com": true},
		{"https://www.myorg1.com": true},
		{"https://www.myorg1.com:443": true},
		{"https://www.myorg2.com": false},
		{"myorg2.com": false},
		{"myorg1:myorg1": false},
	},
	ScutilBypassTest3: {
		{"endpoint.myorg2.com": true},
		{"myorg2.com": false},
		{"myorg2.com:1234": false},
		{"endpoint.myorg2.com:443": true},
		{"https://endpoint.myorg2.com": true},
		{"https://endpoint.myorg2.com:8443": true},
		{"test.endpoint.myorg2.com": true},
		{"test.endpoint.myorg2.com:1234": true},
		{"https://test.endpoint.myorg2.com:1234": true},
		{"test.endpoint.com": false},
	},
	ScutilBypassTest4: {
		{"endpoint.myorg3.com": true},
		{"myorg3.com": false},
		{"myorg3.com:1234": false},
		{"endpoint.myorg3.com:443": true},
		{"https://endpoint.myorg3.com": true},
		{"https://endpoint.myorg3.com:8443": true},
		{"test.endpoint.myorg3.com": true},
		{"test.endpoint.myorg3.com:1234": true},
		{"https://test.endpoint.myorg3.com:1234": true},
		{"test.endpoint.com": false},
	},
	ScutilBypassTest5: {
		{"endpoint.myorg4.com": true},
		{"myorg4.com": false},
		{"myorg4.com:1234": false},
		{"endpoint.myorg4.com:443": true},
		{"https://endpoint.myorg4.com": true},
		{"https://endpoint.myorg4.com:8443": true},
		{"test.endpoint.myorg4.com": true},
		{"test.endpoint.myorg4.com:1234": true},
		{"https://test.endpoint.myorg4.com:1234": true},
		{"test.endpoint.com": false},
	},
	ScutilBypassTest6: {
		{"test.endpoint.myorg5.com": true},
		{"myorg5.com": false},
		{"myorg5.com:1234": false},
		{"endpoint.myorg5.com": false},
		{"endpoint.myorg5.com:443": false},
		{"https://test.endpoint.myorg5.com": true},
		{"https://test.endpoint.myorg5.com:8443": true},
		{"test1.test.endpoint.myorg5.com": true},
		{"test1.test.endpoint.myorg5.com:1234": true},
		{"https://test1.test.endpoint.myorg5.com:1234": true},
		{"test.endpoint.com": false},
	},
}
var providerDarwinTestCaseBypass = fmt.Sprintf("<dictionary> {\n  ExceptionsList : <array> {\n    0 : %s\n    1 : %s\n    2 : %s\n    "+
	"3 : %s\n    4: %s\n    5: %s\n    6 : %s\n  }\n  HTTPEnable : 0\n  HTTPSEnable : 1\n  HTTPSPort : 1234\n "+
	"HTTPSProxy : 1.2.3.4\n}\n", ScutilBypassTest1, ScutilBypassTest2, ScutilBypassTest3, ScutilBypassTest4,
	ScutilBypassTest5, ScutilBypassTest6, ScutilBypassTest7)
func getDarwinProviderTestsNoBypass(key string) []string {
	var s []string
	for _, v := range providerDarwinTestCasesNoBypass {
		if v.testType == key {
			s = append(s, v.test)
		}
	}
	return s
}
func TestParseScutildata_Read_HTTPS_HTTP(t *testing.T) {
	a := assert.New(t)
	c := newDarwinTestProvider()
	commands := getDarwinProviderTestsNoBypass(ScutilDataHttpsHttp)
	targetUrl := ParseTargetURL("", "")
	protocols := [4]string{"http", "https", "HTTP", "HTTPS"}
	for _, protocol := range protocols {
		for _, command := range commands {
			expectedProxy, err := c.parseScutildata(protocol, targetUrl, "echo", command)
			a.Nil(err)
			a.NotNil(expectedProxy)
			a.Equal(&proxy{src: "State:/Network/Global/Proxies", host: "1.2.3.4", port: 1234},
				expectedProxy)
		}
	}
}