From c89a0247adad3fd62b12e6de5022976a5e82e028 Mon Sep 17 00:00:00 2001 From: Alexander Andryashin Date: Fri, 8 Sep 2017 17:09:27 +0300 Subject: [PATCH] Fix #114 (#115) Fix #114 * Fixed test --- config.go | 2 +- config_test.go | 6 +++--- docs/.DS_Store | Bin 6148 -> 0 bytes proxy.go | 2 +- proxy_test.go | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 52 insertions(+), 5 deletions(-) delete mode 100644 docs/.DS_Store diff --git a/config.go b/config.go index 0b9ad6d..e2cba19 100644 --- a/config.go +++ b/config.go @@ -116,7 +116,7 @@ func (b *Browsers) find(browser, version string, excludedHosts set, excludedRegi continue next } for _, h := range r.Hosts { - if !excludedHosts.contains(h.Name) { + if !excludedHosts.contains(h.net()) { hosts = append(hosts, h) } } diff --git a/config_test.go b/config_test.go index ff0370e..8696977 100644 --- a/config_test.go +++ b/config_test.go @@ -63,10 +63,10 @@ var ( {Name: "browser", DefaultVersion: "1.0", Versions: []Version{ {Number: "1.0", Regions: []Region{ {Name: "e", Hosts: Hosts{ - Host{Name: "browser-e-1.0"}, + Host{Name: "browser-e-1.0", Port: 4444}, }}, {Name: "f", Hosts: Hosts{ - Host{Name: "browser-f-1.0"}, + Host{Name: "browser-f-1.0", Port: 4444}, }}, }}, }}}} @@ -113,7 +113,7 @@ func TestFindWithExcludedRegionsExhausted(t *testing.T) { } func TestFindWithExcludedHosts(t *testing.T) { - hosts, version, _ := browsersWithMultipleRegions.find("browser", "1.0", newSet("browser-e-1.0"), newSet()) + hosts, version, _ := browsersWithMultipleRegions.find("browser", "1.0", newSet("browser-e-1.0:4444"), newSet()) AssertThat(t, version, EqualTo{"1.0"}) AssertThat(t, len(hosts), EqualTo{1}) AssertThat(t, hosts[0].Name, EqualTo{"browser-f-1.0"}) diff --git a/docs/.DS_Store b/docs/.DS_Store deleted file mode 100644 index ae216f60e5f44af51c06a5f6b3a96a986b4898a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8CMX&~P;a?;>7oAX$q?(wix9B~D>Wgd4b*IDQ+uez9Q}O`(I*mo z8E1C4#ZtX^5GgY-`_0bI?6P0N&Msq&yPa^IF^e%~fFfp0Xuc5~M;()l_8@YcqumS| zB7ojU&>V{<$A4r1zg?C^?26Tb?$__vh}ub^@Xj;Y+|=}pVVdTgIlo|Dcy-bB5tybuFy_M?b&+N0X>W3=jho#Q@J0y`l?S(zSJLb69I_ s&`VGhj7t>`Q^1g=7-F#$uYgJczl{c