forked from masterzen/winrm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendpoint_test.go
More file actions
27 lines (21 loc) · 767 Bytes
/
endpoint_test.go
File metadata and controls
27 lines (21 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package winrm
import (
"time"
. "gopkg.in/check.v1"
)
func (s *WinRMSuite) TestEndpointUrlHttp(c *C) {
endpoint := &Endpoint{Host: "abc", Port: 123}
c.Assert(endpoint.url(), Equals, "http://abc:123/wsman")
}
func (s *WinRMSuite) TestEndpointUrlHttps(c *C) {
endpoint := &Endpoint{Host: "abc", Port: 123, HTTPS: true}
c.Assert(endpoint.url(), Equals, "https://abc:123/wsman")
}
func (s *WinRMSuite) TestEndpointWithDefaultTimeout(c *C) {
endpoint := NewEndpoint("test", 5585, false, false, nil, nil, nil, 0)
c.Assert(endpoint.Timeout, Equals, 60*time.Second)
}
func (s *WinRMSuite) TestEndpointWithTimeout(c *C) {
endpoint := NewEndpoint("test", 5585, false, false, nil, nil, nil, 120*time.Second)
c.Assert(endpoint.Timeout, Equals, 120*time.Second)
}