def test_load_lambdas(self): contents_data = contents.load(self.config) dynamic_templates = templates.load(self.config) lambdas_data = lambdas.load(self.config, contents_data, dynamic_templates) for k,v in lambdas_data.items(): assert types.FunctionType == type(v) assert len(lambdas_data) == 2
def test_htmlstache(self): contents_data = contents.load(self.config) dynamic_templates = templates.load(self.config) lambdas_data = lambdas.load(self.config, contents_data, dynamic_templates) template = read_yaml(self.config["templates_path"], "blog.mustache")[1] stache = templates.to_htmlstache(self.config, template, lambdas=lambdas_data) assert stache != None assert "Test" in stache
def test_all_bakes(self): contents_data = contents.load(self.config) dynamic_templates = templates.load(self.config) lambdas_data = lambdas.load(self.config, contents_data, dynamic_templates) contents.bake(self.config, contents_data, lambdas_data) templates.bake(self.config, dynamic_templates, lambdas_data) for content in contents_data: assert "html" in content assert content["html"] != None for template in dynamic_templates: assert "html" in template assert template["html"] != None
def test_load_dynamic_templates(self): dynamic_templates = templates.load(self.config) for template in dynamic_templates: assert types.DictType == type(template) assert 1 == len(dynamic_templates) assert dynamic_templates[0]['name'] == "blog"