aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/tests/__init__.py16
-rw-r--r--markdown/tests/extensions-x-abbr/test.cfg2
-rw-r--r--markdown/tests/extensions-x-codehilite/test.cfg2
-rw-r--r--markdown/tests/extensions-x-def_list/test.cfg2
-rw-r--r--markdown/tests/extensions-x-footnotes/test.cfg2
-rw-r--r--markdown/tests/extensions-x-tables/test.cfg2
-rw-r--r--markdown/tests/extensions-x-toc/test.cfg2
-rw-r--r--markdown/tests/extensions-x-wikilinks/test.cfg2
-rw-r--r--markdown/tests/extensions/codehilite.html (renamed from markdown/tests/extensions-x-codehilite/code.html)0
-rw-r--r--markdown/tests/extensions/codehilite.txt (renamed from markdown/tests/extensions-x-codehilite/code.txt)0
-rw-r--r--markdown/tests/extensions/extra/abbr.html (renamed from markdown/tests/extensions-x-abbr/abbr.html)0
-rw-r--r--markdown/tests/extensions/extra/abbr.txt (renamed from markdown/tests/extensions-x-abbr/abbr.txt)0
-rw-r--r--markdown/tests/extensions/extra/footnote.html (renamed from markdown/tests/extensions-x-footnotes/footnote.html)0
-rw-r--r--markdown/tests/extensions/extra/footnote.txt (renamed from markdown/tests/extensions-x-footnotes/footnote.txt)0
-rw-r--r--markdown/tests/extensions/extra/loose_def_list.html (renamed from markdown/tests/extensions-x-def_list/loose_def_list.html)0
-rw-r--r--markdown/tests/extensions/extra/loose_def_list.txt (renamed from markdown/tests/extensions-x-def_list/loose_def_list.txt)0
-rw-r--r--markdown/tests/extensions/extra/markdown-syntax.html (renamed from markdown/tests/extensions-x-def_list/markdown-syntax.html)0
-rw-r--r--markdown/tests/extensions/extra/markdown-syntax.txt (renamed from markdown/tests/extensions-x-def_list/markdown-syntax.txt)0
-rw-r--r--markdown/tests/extensions/extra/named_markers.html (renamed from markdown/tests/extensions-x-footnotes/named_markers.html)0
-rw-r--r--markdown/tests/extensions/extra/named_markers.txt (renamed from markdown/tests/extensions-x-footnotes/named_markers.txt)0
-rw-r--r--markdown/tests/extensions/extra/simple_def-lists.html (renamed from markdown/tests/extensions-x-def_list/simple_def-lists.html)0
-rw-r--r--markdown/tests/extensions/extra/simple_def-lists.txt (renamed from markdown/tests/extensions-x-def_list/simple_def-lists.txt)0
-rw-r--r--markdown/tests/extensions/extra/tables.html (renamed from markdown/tests/extensions-x-tables/tables.html)0
-rw-r--r--markdown/tests/extensions/extra/tables.txt (renamed from markdown/tests/extensions-x-tables/tables.txt)0
-rw-r--r--markdown/tests/extensions/extra/test.cfg17
-rw-r--r--markdown/tests/extensions/test.cfg11
-rw-r--r--markdown/tests/extensions/toc.html (renamed from markdown/tests/extensions-x-toc/syntax-toc.html)0
-rw-r--r--markdown/tests/extensions/toc.txt (renamed from markdown/tests/extensions-x-toc/syntax-toc.txt)0
-rw-r--r--markdown/tests/extensions/toc_invalid.html (renamed from markdown/tests/extensions-x-toc/invalid.html)0
-rw-r--r--markdown/tests/extensions/toc_invalid.txt (renamed from markdown/tests/extensions-x-toc/invalid.txt)0
-rw-r--r--markdown/tests/extensions/wikilinks.html (renamed from markdown/tests/extensions-x-wikilinks/wikilinks.html)0
-rw-r--r--markdown/tests/extensions/wikilinks.txt (renamed from markdown/tests/extensions-x-wikilinks/wikilinks.txt)0
32 files changed, 40 insertions, 18 deletions
diff --git a/markdown/tests/__init__.py b/markdown/tests/__init__.py
index 5834e17..eca1bba 100644
--- a/markdown/tests/__init__.py
+++ b/markdown/tests/__init__.py
@@ -12,15 +12,23 @@ test_dir = os.path.abspath(os.path.dirname(__file__))
def normalize(text):
return ['%s\n' % l for l in text.strip().split('\n')]
+def get_args(file, config):
+ args = {}
+ filename = os.path.basename(file)
+ if config.has_section(filename):
+ section = filename
+ else:
+ section = 'DEFAULT'
+ for key in ['extensions', 'safe_mode', 'output_format']:
+ args[key] = config.get(section, key)
+ return args
+
def check_syntax(file, config):
input_file = file + ".txt"
input = codecs.open(input_file, encoding="utf-8").read()
output_file = file + ".html"
expected_output = codecs.open(output_file, encoding="utf-8").read()
- output = normalize(markdown.markdown(input,
- config.get('DEFAULT', 'extensions'),
- config.get('DEFAULT', 'safe_mode'),
- config.get('DEFAULT', 'output_format')))
+ output = normalize(markdown.markdown(input, **get_args(file, config)))
diff = [l for l in difflib.unified_diff(normalize(expected_output),
output, output_file,
'actual_output.html', n=3)]
diff --git a/markdown/tests/extensions-x-abbr/test.cfg b/markdown/tests/extensions-x-abbr/test.cfg
deleted file mode 100644
index 32d437f..0000000
--- a/markdown/tests/extensions-x-abbr/test.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[DEFAULT]
-extensions=abbr
diff --git a/markdown/tests/extensions-x-codehilite/test.cfg b/markdown/tests/extensions-x-codehilite/test.cfg
deleted file mode 100644
index 6ed10a2..0000000
--- a/markdown/tests/extensions-x-codehilite/test.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[DEFAULT]
-extensions=codehilite
diff --git a/markdown/tests/extensions-x-def_list/test.cfg b/markdown/tests/extensions-x-def_list/test.cfg
deleted file mode 100644
index c9f352d..0000000
--- a/markdown/tests/extensions-x-def_list/test.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[DEFAULT]
-extensions=def_list
diff --git a/markdown/tests/extensions-x-footnotes/test.cfg b/markdown/tests/extensions-x-footnotes/test.cfg
deleted file mode 100644
index a5f0818..0000000
--- a/markdown/tests/extensions-x-footnotes/test.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[DEFAULT]
-extensions=footnotes
diff --git a/markdown/tests/extensions-x-tables/test.cfg b/markdown/tests/extensions-x-tables/test.cfg
deleted file mode 100644
index ce5a83d..0000000
--- a/markdown/tests/extensions-x-tables/test.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[DEFAULT]
-extensions=tables
diff --git a/markdown/tests/extensions-x-toc/test.cfg b/markdown/tests/extensions-x-toc/test.cfg
deleted file mode 100644
index e4bc0fe..0000000
--- a/markdown/tests/extensions-x-toc/test.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[DEFAULT]
-extensions=toc
diff --git a/markdown/tests/extensions-x-wikilinks/test.cfg b/markdown/tests/extensions-x-wikilinks/test.cfg
deleted file mode 100644
index 959f38a..0000000
--- a/markdown/tests/extensions-x-wikilinks/test.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[DEFAULT]
-extensions=wikilinks
diff --git a/markdown/tests/extensions-x-codehilite/code.html b/markdown/tests/extensions/codehilite.html
index 6a8ee91..6a8ee91 100644
--- a/markdown/tests/extensions-x-codehilite/code.html
+++ b/markdown/tests/extensions/codehilite.html
diff --git a/markdown/tests/extensions-x-codehilite/code.txt b/markdown/tests/extensions/codehilite.txt
index 6c62e6a..6c62e6a 100644
--- a/markdown/tests/extensions-x-codehilite/code.txt
+++ b/markdown/tests/extensions/codehilite.txt
diff --git a/markdown/tests/extensions-x-abbr/abbr.html b/markdown/tests/extensions/extra/abbr.html
index 456524e..456524e 100644
--- a/markdown/tests/extensions-x-abbr/abbr.html
+++ b/markdown/tests/extensions/extra/abbr.html
diff --git a/markdown/tests/extensions-x-abbr/abbr.txt b/markdown/tests/extensions/extra/abbr.txt
index 991bf15..991bf15 100644
--- a/markdown/tests/extensions-x-abbr/abbr.txt
+++ b/markdown/tests/extensions/extra/abbr.txt
diff --git a/markdown/tests/extensions-x-footnotes/footnote.html b/markdown/tests/extensions/extra/footnote.html
index 6556dab..6556dab 100644
--- a/markdown/tests/extensions-x-footnotes/footnote.html
+++ b/markdown/tests/extensions/extra/footnote.html
diff --git a/markdown/tests/extensions-x-footnotes/footnote.txt b/markdown/tests/extensions/extra/footnote.txt
index 07188d0..07188d0 100644
--- a/markdown/tests/extensions-x-footnotes/footnote.txt
+++ b/markdown/tests/extensions/extra/footnote.txt
diff --git a/markdown/tests/extensions-x-def_list/loose_def_list.html b/markdown/tests/extensions/extra/loose_def_list.html
index 98fdec8..98fdec8 100644
--- a/markdown/tests/extensions-x-def_list/loose_def_list.html
+++ b/markdown/tests/extensions/extra/loose_def_list.html
diff --git a/markdown/tests/extensions-x-def_list/loose_def_list.txt b/markdown/tests/extensions/extra/loose_def_list.txt
index 24cd6a4..24cd6a4 100644
--- a/markdown/tests/extensions-x-def_list/loose_def_list.txt
+++ b/markdown/tests/extensions/extra/loose_def_list.txt
diff --git a/markdown/tests/extensions-x-def_list/markdown-syntax.html b/markdown/tests/extensions/extra/markdown-syntax.html
index 038c9d1..038c9d1 100644
--- a/markdown/tests/extensions-x-def_list/markdown-syntax.html
+++ b/markdown/tests/extensions/extra/markdown-syntax.html
diff --git a/markdown/tests/extensions-x-def_list/markdown-syntax.txt b/markdown/tests/extensions/extra/markdown-syntax.txt
index dabd75c..dabd75c 100644
--- a/markdown/tests/extensions-x-def_list/markdown-syntax.txt
+++ b/markdown/tests/extensions/extra/markdown-syntax.txt
diff --git a/markdown/tests/extensions-x-footnotes/named_markers.html b/markdown/tests/extensions/extra/named_markers.html
index 6996b5f..6996b5f 100644
--- a/markdown/tests/extensions-x-footnotes/named_markers.html
+++ b/markdown/tests/extensions/extra/named_markers.html
diff --git a/markdown/tests/extensions-x-footnotes/named_markers.txt b/markdown/tests/extensions/extra/named_markers.txt
index d246524..d246524 100644
--- a/markdown/tests/extensions-x-footnotes/named_markers.txt
+++ b/markdown/tests/extensions/extra/named_markers.txt
diff --git a/markdown/tests/extensions-x-def_list/simple_def-lists.html b/markdown/tests/extensions/extra/simple_def-lists.html
index 278e1ec..278e1ec 100644
--- a/markdown/tests/extensions-x-def_list/simple_def-lists.html
+++ b/markdown/tests/extensions/extra/simple_def-lists.html
diff --git a/markdown/tests/extensions-x-def_list/simple_def-lists.txt b/markdown/tests/extensions/extra/simple_def-lists.txt
index 20c028a..20c028a 100644
--- a/markdown/tests/extensions-x-def_list/simple_def-lists.txt
+++ b/markdown/tests/extensions/extra/simple_def-lists.txt
diff --git a/markdown/tests/extensions-x-tables/tables.html b/markdown/tests/extensions/extra/tables.html
index c931e6a..c931e6a 100644
--- a/markdown/tests/extensions-x-tables/tables.html
+++ b/markdown/tests/extensions/extra/tables.html
diff --git a/markdown/tests/extensions-x-tables/tables.txt b/markdown/tests/extensions/extra/tables.txt
index 64917ab..64917ab 100644
--- a/markdown/tests/extensions-x-tables/tables.txt
+++ b/markdown/tests/extensions/extra/tables.txt
diff --git a/markdown/tests/extensions/extra/test.cfg b/markdown/tests/extensions/extra/test.cfg
new file mode 100644
index 0000000..74893f0
--- /dev/null
+++ b/markdown/tests/extensions/extra/test.cfg
@@ -0,0 +1,17 @@
+[DEFAULT]
+extensions=extra
+
+[loose_def_list]
+extensions=def_list
+
+[simple_def-lists]
+extensions=def_list
+
+[abbr]
+extensions=abbr
+
+[footnotes]
+extensions=footnotes
+
+[tables]
+extensions=tables
diff --git a/markdown/tests/extensions/test.cfg b/markdown/tests/extensions/test.cfg
new file mode 100644
index 0000000..3a15b7b
--- /dev/null
+++ b/markdown/tests/extensions/test.cfg
@@ -0,0 +1,11 @@
+[codehilite]
+extensions=codehilite
+
+[toc]
+extensions=toc
+
+[toc_invalid]
+extensions=toc
+
+[wikilinks]
+extensions=wikilinks
diff --git a/markdown/tests/extensions-x-toc/syntax-toc.html b/markdown/tests/extensions/toc.html
index 3559d45..3559d45 100644
--- a/markdown/tests/extensions-x-toc/syntax-toc.html
+++ b/markdown/tests/extensions/toc.html
diff --git a/markdown/tests/extensions-x-toc/syntax-toc.txt b/markdown/tests/extensions/toc.txt
index f297200..f297200 100644
--- a/markdown/tests/extensions-x-toc/syntax-toc.txt
+++ b/markdown/tests/extensions/toc.txt
diff --git a/markdown/tests/extensions-x-toc/invalid.html b/markdown/tests/extensions/toc_invalid.html
index 41a3b1f..41a3b1f 100644
--- a/markdown/tests/extensions-x-toc/invalid.html
+++ b/markdown/tests/extensions/toc_invalid.html
diff --git a/markdown/tests/extensions-x-toc/invalid.txt b/markdown/tests/extensions/toc_invalid.txt
index f6c4ec4..f6c4ec4 100644
--- a/markdown/tests/extensions-x-toc/invalid.txt
+++ b/markdown/tests/extensions/toc_invalid.txt
diff --git a/markdown/tests/extensions-x-wikilinks/wikilinks.html b/markdown/tests/extensions/wikilinks.html
index a76a693..a76a693 100644
--- a/markdown/tests/extensions-x-wikilinks/wikilinks.html
+++ b/markdown/tests/extensions/wikilinks.html
diff --git a/markdown/tests/extensions-x-wikilinks/wikilinks.txt b/markdown/tests/extensions/wikilinks.txt
index 8e6911b..8e6911b 100644
--- a/markdown/tests/extensions-x-wikilinks/wikilinks.txt
+++ b/markdown/tests/extensions/wikilinks.txt