@@ -9,10 +9,10 @@ import (
9
9
)
10
10
11
11
// ===========================
12
- // wrapper.determineDockerHost ()
12
+ // wrapper.determineHostname ()
13
13
// ===========================
14
14
15
- var wrapperInstanceDetermineDockerHostTests = []struct {
15
+ var wrapperInstanceDetermineHostnameTests = []struct {
16
16
it string
17
17
inputDockerAddress string
18
18
doAssertions func (t * testing.T , actualInstance WrapperInstance , actualErr error )
@@ -22,21 +22,21 @@ var wrapperInstanceDetermineDockerHostTests = []struct {
22
22
inputDockerAddress : "unix:///var/run/docker.sock" ,
23
23
doAssertions : func (t * testing.T , actualInstance WrapperInstance , actualErr error ) {
24
24
assert .NoError (t , actualErr )
25
- assert .Equal (t , "localhost" , actualInstance .DockerHost )
25
+ assert .Equal (t , "localhost" , actualInstance .Hostname )
26
26
},
27
27
},
28
28
{
29
29
it : "should return the host from pool when not starting with unix://" ,
30
30
inputDockerAddress : "http://docker:2375" ,
31
31
doAssertions : func (t * testing.T , actualInstance WrapperInstance , actualErr error ) {
32
32
assert .NoError (t , actualErr )
33
- assert .Equal (t , "docker" , actualInstance .DockerHost )
33
+ assert .Equal (t , "docker" , actualInstance .Hostname )
34
34
},
35
35
},
36
36
}
37
37
38
- func TestWrapperInstance_DetermineDockerHost (t * testing.T ) {
39
- for _ , test := range wrapperInstanceDetermineDockerHostTests {
38
+ func TestWrapperInstance_DetermineHostname (t * testing.T ) {
39
+ for _ , test := range wrapperInstanceDetermineHostnameTests {
40
40
test := test
41
41
t .Run (test .it , func (t * testing.T ) {
42
42
client , err := docker .NewClient (test .inputDockerAddress )
@@ -47,17 +47,17 @@ func TestWrapperInstance_DetermineDockerHost(t *testing.T) {
47
47
Client : client ,
48
48
},
49
49
}
50
- actualErr := actualWrapper .determineDockerHost ()
50
+ actualErr := actualWrapper .determineHostname ()
51
51
test .doAssertions (t , actualWrapper , actualErr )
52
52
})
53
53
}
54
54
}
55
55
56
56
// ===========================
57
- // wrapper.determineHostPort ()
57
+ // wrapper.determinePort ()
58
58
// ===========================
59
59
60
- var wrapperInstanceDetermineHostPortTests = []struct {
60
+ var wrapperInstanceDeterminePortTests = []struct {
61
61
it string
62
62
inputContainerPort string
63
63
internalHostPort string
@@ -69,7 +69,7 @@ var wrapperInstanceDetermineHostPortTests = []struct {
69
69
internalHostPort : "5432/tcp" ,
70
70
doAssertions : func (t * testing.T , instance WrapperInstance , actualErr error ) {
71
71
assert .Error (t , actualErr )
72
- assert .Equal (t , 0 , instance .HostPort )
72
+ assert .Equal (t , 0 , instance .Port )
73
73
},
74
74
},
75
75
{
@@ -78,13 +78,13 @@ var wrapperInstanceDetermineHostPortTests = []struct {
78
78
internalHostPort : "5432" ,
79
79
doAssertions : func (t * testing.T , instance WrapperInstance , actualErr error ) {
80
80
assert .NoError (t , actualErr )
81
- assert .Equal (t , 5432 , instance .HostPort )
81
+ assert .Equal (t , 5432 , instance .Port )
82
82
},
83
83
},
84
84
}
85
85
86
- func TestWrapperInstance_DetermineHostPort (t * testing.T ) {
87
- for _ , test := range wrapperInstanceDetermineHostPortTests {
86
+ func TestWrapperInstance_DeterminePort (t * testing.T ) {
87
+ for _ , test := range wrapperInstanceDeterminePortTests {
88
88
test := test
89
89
t .Run (test .it , func (t * testing.T ) {
90
90
mockedPortBinding := map [docker.Port ][]docker.PortBinding {}
@@ -106,7 +106,7 @@ func TestWrapperInstance_DetermineHostPort(t *testing.T) {
106
106
Resource : & mockedResource ,
107
107
}
108
108
109
- actualErr := actualWrapper .determineHostPort (test .inputContainerPort )
109
+ actualErr := actualWrapper .determinePort (test .inputContainerPort )
110
110
test .doAssertions (t , actualWrapper , actualErr )
111
111
})
112
112
}
0 commit comments