Skip to content

Commit fc6d023

Browse files
committed
Add tests for arbitrary tags
1 parent fd86b2f commit fc6d023

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extensions = ["sphinxext.opengraph"]
2+
3+
master_doc = "index"
4+
exclude_patterns = ["_build"]
5+
6+
html_theme = "basic"
7+
8+
ogp_site_url = "http://example.org/"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:og:video: http://example.org/video.mp4
2+
:og:video:type: video/mp4
3+
4+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.

tests/test_options.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ def test_overrides_complex(og_meta_tags):
180180
assert get_tag_content(og_meta_tags, "image:alt") == "Overridden Alt Text"
181181

182182

183+
@pytest.mark.sphinx("html", testroot="arbitrary-tags")
184+
def test_arbitrary_tags(og_meta_tags):
185+
assert get_tag_content(og_meta_tags, "video") == "http://example.org/video.mp4"
186+
assert get_tag_content(og_meta_tags, "video:type") == "video/mp4"
187+
188+
183189
# use same as simple, as configuration is identical to overriden
184190
@pytest.mark.sphinx("html", testroot="simple")
185191
def test_rtd_override(app: Sphinx, monkeypatch):

0 commit comments

Comments
 (0)