-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_revealjs_options.py
62 lines (52 loc) · 1.45 KB
/
test_revealjs_options.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import re
from typing import Any
from tests.utils import (
assert_html_contains,
assert_html_contains_regexp,
run_build,
run_build_with_config,
)
# Necessary for livereload to work properly
def test_revealjs_default_options(setup_paths: Any) -> None:
cwd, output_path = setup_paths
run_build(cwd, output_path)
assert_html_contains(
output_path / "someslides.html",
[
"history: true,",
],
)
def test_revealjs_integer_options(setup_paths: Any) -> None:
cwd, output_path = setup_paths
run_build_with_config(cwd, output_path, "test_revealjs_integer_options.yml")
assert_html_contains_regexp(
output_path / "someslides.html",
re.compile(
r"""
Reveal\.initialize\({
.*?
height:\s+1080,
.*?
width:\s+1920,
.*?
}\);
""",
re.VERBOSE | re.DOTALL,
),
)
def test_revealjs_string_options(setup_paths: Any) -> None:
cwd, output_path = setup_paths
run_build_with_config(cwd, output_path, "test_revealjs_string_options.yml")
assert_html_contains_regexp(
output_path / "someslides.html",
re.compile(
r"""
Reveal\.initialize\({
.*?
transition:\s+"fade",
.*?
}\);
""",
re.VERBOSE | re.DOTALL,
),
)