def test_template_loader_load_template_file_content(self): loader = TemplateLoader(template_path="examples/template/") file_path = loader.find_abs_path("login.htm") with open("examples/template/login.htm") as f: self.assertEqual(f.read(), loader.load_template_file_content(file_path))
def test_template_loader_find_abs_path(self): loader = TemplateLoader(template_path="examples/template/") file_path = loader.find_abs_path("login.htm") self.assertEqual(file_path, os.path.realpath("examples/template/login.htm")) self.assertRaises(FileNotFoundError, loader.find_abs_path, "login.html")