mirror of
https://github.com/1f349/site-hosting.git
synced 2024-11-23 20:21:35 +00:00
34 lines
618 B
Go
34 lines
618 B
Go
package serve
|
|
|
|
import (
|
|
"github.com/1f349/bluebell/conf"
|
|
"github.com/spf13/afero"
|
|
"testing"
|
|
)
|
|
|
|
func makeConfig(f afero.Fs) (*conf.Conf, error) {
|
|
c := conf.New(f)
|
|
return c, c.Load()
|
|
}
|
|
|
|
func TestName(t *testing.T) {
|
|
f := afero.NewMemMapFs()
|
|
h := &Handler{
|
|
storageFs: f,
|
|
conf: conf.Testable([]conf.SiteConf{
|
|
{Domain: "example.com", Token: "abcd1234"},
|
|
}),
|
|
}
|
|
h.findSiteBranchSubdomain("example-com-test")
|
|
site, branch := h.findSiteBranch("example-com_test")
|
|
}
|
|
|
|
func TestHandler_Handle(t *testing.T) {
|
|
f := afero.NewMemMapFs()
|
|
h := &Handler{
|
|
storageFs: f,
|
|
conf: &conf.Conf{},
|
|
}
|
|
h.Handle()
|
|
}
|