Debian Codegraph @

dnsimple/services_domains_test.go

raw symbols SCIP
1 package dnsimplescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/
2
3 import (
4 "contextscip-go gomod github.com/golang/go/src go1.21 context/"
5 "ioscip-go gomod github.com/golang/go/src go1.21 io/"
6 "net/httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/"
7 "net/urlscip-go gomod github.com/golang/go/src go1.21 `net/url`/"
8 "testingscip-go gomod github.com/golang/go/src go1.21 testing/"
9
10 "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/"
11 )
12
13 func TestDomainServices_domainServicesPathscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/TestDomainServices_domainServicesPath().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
14 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/Equal().(t, "/1010/domains/example.com/services", domainServicesPathscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/domainServicesPath().("1010", "example.com", ""))
15 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/Equal().(t, "/1010/domains/example.com/services/1", domainServicesPathscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/domainServicesPath().("1010", "example.com", "1"))
16 }
17
18 func TestServicesService_AppliedServicesscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/TestServicesService_AppliedServices().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
19 setupMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/setupMockServer().()
20 defer teardownMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/teardownMockServer().()
21
22 muxscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/mux..HandleFuncscip-go gomod github.com/golang/go/src go1.21 `net/http`/ServeMux#HandleFunc().("/v2/1010/domains/example.com/services", func(w httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.ResponseWriterscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#, r *httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.21 `net/http`/Request#) {
23 httpResponse := httpResponseFixturescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/httpResponseFixture().(t, "/api/appliedServices/success.http")
24
25 testMethodscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testMethod().(t, r, "GET")
26 testHeadersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testHeaders().(t, r)
27 testQueryscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testQuery().(t, r, urlscip-go gomod github.com/golang/go/src go1.21 `net/url`/.Valuesscip-go gomod github.com/golang/go/src go1.21 `net/url`/Values#{})
28
29 w.WriteHeaderscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#WriteHeader().(httpResponse.StatusCodescip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#StatusCode.)
30 _, _ = ioscip-go gomod github.com/golang/go/src go1.21 io/.Copyscip-go gomod github.com/golang/go/src go1.21 io/Copy().(w, httpResponse.Bodyscip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#Body.)
31 })
32
33 servicesResponse, err := clientscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/client..Servicesscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Client#Services..AppliedServicesscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/ServicesService#AppliedServices().(contextscip-go gomod github.com/golang/go/src go1.21 context/.Backgroundscip-go gomod github.com/golang/go/src go1.21 context/Background().(), "1010", "example.com", nil)
34
35 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/NoError().(t, err)
36 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/Equal().(t, &Paginationscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Pagination#{CurrentPagescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Pagination#CurrentPage.: 1, PerPagescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Pagination#PerPage.: 30, TotalPagesscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Pagination#TotalPages.: 1, TotalEntriesscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Pagination#TotalEntries.: 1}, servicesResponse.Paginationscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Response#Pagination.)
37 services := servicesResponse.Datascip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/ServicesResponse#Data.
38 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/Len().(t, services, 1)
39 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/Equal().(t, int64(1), services[0].IDscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Service#ID.)
40 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/Equal().(t, "wordpress", services[0].SIDscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Service#SID.)
41 }
42
43 func TestServicesService_ApplyServicescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/TestServicesService_ApplyService().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
44 setupMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/setupMockServer().()
45 defer teardownMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/teardownMockServer().()
46
47 muxscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/mux..HandleFuncscip-go gomod github.com/golang/go/src go1.21 `net/http`/ServeMux#HandleFunc().("/v2/1010/domains/example.com/services/service1", func(w httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.ResponseWriterscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#, r *httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.21 `net/http`/Request#) {
48 httpResponse := httpResponseFixturescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/httpResponseFixture().(t, "/api/applyService/success.http")
49
50 testMethodscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testMethod().(t, r, "POST")
51 testHeadersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testHeaders().(t, r)
52
53 w.WriteHeaderscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#WriteHeader().(httpResponse.StatusCodescip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#StatusCode.)
54 _, _ = ioscip-go gomod github.com/golang/go/src go1.21 io/.Copyscip-go gomod github.com/golang/go/src go1.21 io/Copy().(w, httpResponse.Bodyscip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#Body.)
55 })
56
57 settings := DomainServiceSettingsscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/DomainServiceSettings#{Settingsscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/DomainServiceSettings#Settings.: map[string]string{"app": "foo"}}
58
59 _, err := clientscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/client..Servicesscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Client#Services..ApplyServicescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/ServicesService#ApplyService().(contextscip-go gomod github.com/golang/go/src go1.21 context/.Backgroundscip-go gomod github.com/golang/go/src go1.21 context/Background().(), "1010", "service1", "example.com", settings)
60
61 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/NoError().(t, err)
62 }
63
64 func TestServicesService_UnapplyServicescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/TestServicesService_UnapplyService().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
65 setupMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/setupMockServer().()
66 defer teardownMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/teardownMockServer().()
67
68 muxscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/mux..HandleFuncscip-go gomod github.com/golang/go/src go1.21 `net/http`/ServeMux#HandleFunc().("/v2/1010/domains/example.com/services/service1", func(w httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.ResponseWriterscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#, r *httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.21 `net/http`/Request#) {
69 httpResponse := httpResponseFixturescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/httpResponseFixture().(t, "/api/unapplyService/success.http")
70
71 testMethodscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testMethod().(t, r, "DELETE")
72 testHeadersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testHeaders().(t, r)
73
74 w.WriteHeaderscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#WriteHeader().(httpResponse.StatusCodescip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#StatusCode.)
75 _, _ = ioscip-go gomod github.com/golang/go/src go1.21 io/.Copyscip-go gomod github.com/golang/go/src go1.21 io/Copy().(w, httpResponse.Bodyscip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#Body.)
76 })
77
78 _, err := clientscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/client..Servicesscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Client#Services..UnapplyServicescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/ServicesService#UnapplyService().(contextscip-go gomod github.com/golang/go/src go1.21 context/.Backgroundscip-go gomod github.com/golang/go/src go1.21 context/Background().(), "1010", "service1", "example.com")
79
80 assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/NoError().(t, err)
81 }