Esempio n. 1
0
func TestParseIntoTemplatePool(t *testing.T) {
	fs := &Fs{}
	pool := view.InitPool()
	fs.ParseIntoTemplatePool(pool, "test_templates")
	if len(pool.Templates) != 1 {
		t.Error("Failed to parse template from test_templates folder into pool")
	}
}
Esempio n. 2
0
func (self *AhcServer) ReadComponents() {
	componentsPool := &component.Pool{}
	self.TemplatesPool = view.InitPool()
	fsParser := self.FsParser
	fsParser.ParseIntoPool(componentsPool, "components")
	fsParser.ParseIntoTemplatePool(self.TemplatesPool, "templates")
	self.TemplatesPool.ComponentsPool = componentsPool
	self.TemplatesStyles = make(map[string][]byte)
}