44 lines
1.0 KiB
Python
44 lines
1.0 KiB
Python
"""
|
|
Unit tests for page content templates
|
|
"""
|
|
|
|
import pytest
|
|
from src.generation.page_templates import get_page_content
|
|
|
|
|
|
def test_get_page_content_about():
|
|
content = get_page_content("about", "www.example.com")
|
|
|
|
assert content == "<h1>About Us</h1>"
|
|
|
|
|
|
def test_get_page_content_contact():
|
|
content = get_page_content("contact", "www.example.com")
|
|
|
|
assert content == "<h1>Contact</h1>"
|
|
|
|
|
|
def test_get_page_content_privacy():
|
|
content = get_page_content("privacy", "www.example.com")
|
|
|
|
assert content == "<h1>Privacy Policy</h1>"
|
|
|
|
|
|
def test_get_page_content_unknown_type():
|
|
content = get_page_content("unknown", "www.example.com")
|
|
|
|
assert content == "<h1>Unknown</h1>"
|
|
|
|
|
|
def test_get_page_content_domain_parameter():
|
|
content = get_page_content("about", "test-site.b-cdn.net")
|
|
|
|
assert "<h1>About Us</h1>" in content
|
|
|
|
|
|
def test_get_page_content_returns_valid_html():
|
|
content = get_page_content("about", "www.example.com")
|
|
|
|
assert content.startswith("<h1>")
|
|
assert content.endswith("</h1>")
|