aboutsummaryrefslogtreecommitdiff
path: root/tests/options_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/options_tests.py')
-rw-r--r--tests/options_tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/options_tests.py b/tests/options_tests.py
new file mode 100644
index 0000000..c646b12
--- /dev/null
+++ b/tests/options_tests.py
@@ -0,0 +1,18 @@
+from nose.tools import istest, assert_equal
+
+from mammoth import style_reader
+from mammoth.options import read_options, _default_style_map
+
+
+@istest
+def default_style_map_is_used_if_style_map_is_not_set():
+ assert_equal(_default_style_map, read_options({})["style_map"])
+
+
+@istest
+def custom_style_mappings_are_prepended_to_default_style_mappings():
+ style_map = read_options({
+ "style_map": "p.SectionTitle => h2"
+ })["style_map"]
+ assert_equal(style_reader.read_style("p.SectionTitle => h2"), style_map[0])
+ assert_equal(_default_style_map, style_map[1:])