本文整理汇总了Golang中github.com/onsi/gomega/ghttp.Server.UnhandledRequestStatusCode方法的典型用法代码示例。如果您正苦于以下问题:Golang Server.UnhandledRequestStatusCode方法的具体用法?Golang Server.UnhandledRequestStatusCode怎么用?Golang Server.UnhandledRequestStatusCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/onsi/gomega/ghttp.Server
的用法示例。
在下文中一共展示了Server.UnhandledRequestStatusCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
)
logger = lagertest.NewTestLogger("test")
bbsPath = string(binaries["bbs"])
bbsAddress := fmt.Sprintf("127.0.0.1:%d", 13000+GinkgoParallelNode())
bbsURL = &url.URL{
Scheme: "http",
Host: bbsAddress,
}
bbsClient = bbs.NewClient(bbsURL.String())
auctioneerServer = ghttp.NewServer()
auctioneerServer.UnhandledRequestStatusCode = http.StatusAccepted
auctioneerServer.AllowUnhandledRequests = true
bbsArgs = bbstestrunner.Args{
Address: bbsAddress,
AdvertiseURL: bbsURL.String(),
AuctioneerAddress: auctioneerServer.URL(),
EtcdCluster: strings.Join(etcdRunner.NodeURLS(), ","),
ConsulCluster: consulRunner.ConsulCluster(),
EncryptionKeys: []string{"label:key"},
ActiveKeyLabel: "label",
}
})
var _ = BeforeEach(func() {
示例2:
etcdAdapter = etcdRunner.Adapter(nil)
routingAPIPort = uint16(6900 + GinkgoParallelNode())
routingAPIIP = "127.0.0.1"
routingAPISystemDomain = "example.com"
routingAPIAddress = fmt.Sprintf("%s:%d", routingAPIIP, routingAPIPort)
routingAPIURL := &url.URL{
Scheme: "http",
Host: routingAPIAddress,
}
client = routing_api.NewClient(routingAPIURL.String())
oauthServer = ghttp.NewTLSServer()
oauthServer.AllowUnhandledRequests = true
oauthServer.UnhandledRequestStatusCode = http.StatusOK
oauthServerPort = getServerPort(oauthServer.URL())
routingAPIArgs = testrunner.Args{
Port: routingAPIPort,
IP: routingAPIIP,
SystemDomain: routingAPISystemDomain,
ConfigPath: createConfig(),
EtcdCluster: etcdUrl,
DevMode: true,
}
})
var _ = AfterEach(func() {
etcdAdapter.Disconnect()
etcdRunner.Reset()