зеркало из https://github.com/golang/pkgsite.git
internal: update references to dochtml
Change-Id: I853d07d59330cd9d86361167449862f3a4d4a7de Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/326057 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
Родитель
cd527b97bc
Коммит
e4258e0a01
|
@ -34,7 +34,7 @@ import (
|
|||
var testTimeout = 30 * time.Second
|
||||
|
||||
var (
|
||||
templateSource = template.TrustedSourceFromConstant("../../content/static/html/doc")
|
||||
templateSource = template.TrustedSourceFromConstant("../../content/static/dochtml")
|
||||
testModules []*proxy.Module
|
||||
)
|
||||
|
||||
|
|
|
@ -81,8 +81,7 @@ func NewServer(scfg ServerConfig) (_ *Server, err error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("error parsing templates: %v", err)
|
||||
}
|
||||
docTemplateDir := template.TrustedSourceJoin(templateDir, template.TrustedSourceFromConstant("html"),
|
||||
template.TrustedSourceFromConstant("doc"))
|
||||
docTemplateDir := template.TrustedSourceJoin(templateDir, template.TrustedSourceFromConstant("dochtml"))
|
||||
dochtml.LoadTemplates(docTemplateDir)
|
||||
s := &Server{
|
||||
getDataSource: scfg.DataSourceGetter,
|
||||
|
|
|
@ -31,7 +31,7 @@ import (
|
|||
"golang.org/x/pkgsite/internal/testing/testhelper"
|
||||
)
|
||||
|
||||
var templateSource = template.TrustedSourceFromConstant("../../../content/static/html/doc")
|
||||
var templateSource = template.TrustedSourceFromConstant("../../../content/static/dochtml")
|
||||
|
||||
var update = flag.Bool("update", false, "update goldens instead of checking against them")
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import (
|
|||
"golang.org/x/pkgsite/internal/testing/htmlcheck"
|
||||
)
|
||||
|
||||
var templateSource = template.TrustedSourceFromConstant("../../content/static/html/doc")
|
||||
var templateSource = template.TrustedSourceFromConstant("../../content/static/dochtml")
|
||||
|
||||
var (
|
||||
in = htmlcheck.In
|
||||
|
|
|
@ -81,7 +81,7 @@ func setup(t *testing.T) (context.Context, func(), *DataSource, error) {
|
|||
},
|
||||
}
|
||||
|
||||
dochtml.LoadTemplates(template.TrustedSourceFromConstant("../../content/static/html/doc"))
|
||||
dochtml.LoadTemplates(template.TrustedSourceFromConstant("../../content/static/dochtml"))
|
||||
datasource = New()
|
||||
ctx, cancel = context.WithTimeout(context.Background(), 20*time.Second)
|
||||
for _, module := range modules {
|
||||
|
|
|
@ -27,7 +27,7 @@ import (
|
|||
var testModules []*proxy.Module
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
dochtml.LoadTemplates(template.TrustedSourceFromConstant("../../content/static/html/doc"))
|
||||
dochtml.LoadTemplates(template.TrustedSourceFromConstant("../../content/static/dochtml"))
|
||||
testModules = proxy.LoadTestModules("../proxy/testdata")
|
||||
licenses.OmitExceptions = true
|
||||
os.Exit(m.Run())
|
||||
|
|
|
@ -31,7 +31,7 @@ var (
|
|||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
dochtml.LoadTemplates(template.TrustedSourceFromConstant("../../../content/static/html/doc"))
|
||||
dochtml.LoadTemplates(template.TrustedSourceFromConstant("../../../content/static/dochtml"))
|
||||
testModules = proxy.LoadTestModules("../../proxy/testdata")
|
||||
postgres.RunDBTests("discovery_integration_test", m, &testDB)
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ func NewServer(cfg *config.Config, scfg ServerConfig) (_ *Server, err error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dochtml.LoadTemplates(template.TrustedSourceJoin(scfg.StaticPath, template.TrustedSourceFromConstant("html/doc")))
|
||||
dochtml.LoadTemplates(template.TrustedSourceJoin(scfg.StaticPath, template.TrustedSourceFromConstant("dochtml")))
|
||||
templates := map[string]*template.Template{
|
||||
indexTemplate: t1,
|
||||
versionsTemplate: t2,
|
||||
|
|
|
@ -40,7 +40,7 @@ var (
|
|||
|
||||
func TestMain(m *testing.M) {
|
||||
httpClient = &http.Client{Transport: fakeTransport{}}
|
||||
dochtml.LoadTemplates(template.TrustedSourceFromConstant("../../content/static/html/doc"))
|
||||
dochtml.LoadTemplates(template.TrustedSourceFromConstant("../../content/static/dochtml"))
|
||||
testModules = proxy.LoadTestModules("../proxy/testdata")
|
||||
postgres.RunDBTests("discovery_worker_test", m, &testDB)
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче