File: endpoint_test.go

package info (click to toggle)
golang-github-masterzen-winrm 0.0~git20200615.c42b513-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 288 kB
  • sloc: makefile: 28; sh: 14
file content (27 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (2)
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)
}