aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2009-06-15 21:45:09 -0400
committerWaylan Limberg <waylan@gmail.com>2009-06-15 21:45:09 -0400
commit79134ae972e1be97afcf7d4380cea41f3918ce9d (patch)
tree602f5cf29dd097ad8f6022e97714f6c3f4234d06
parent402fe9b4898c3c7608596eb9ed9d3ce647a963ef (diff)
downloadmarkdown-79134ae972e1be97afcf7d4380cea41f3918ce9d.tar.gz
markdown-79134ae972e1be97afcf7d4380cea41f3918ce9d.tar.bz2
markdown-79134ae972e1be97afcf7d4380cea41f3918ce9d.zip
Last few changes to get other test frameworks to work. Added config options to set file extensions and a few other tweeks.
-rw-r--r--markdown/tests/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/markdown/tests/__init__.py b/markdown/tests/__init__.py
index d421ed0..ff4916a 100644
--- a/markdown/tests/__init__.py
+++ b/markdown/tests/__init__.py
@@ -52,9 +52,7 @@ def normalize(text):
join_styles=0,
lower_literals=0,
merge_divs=0,
- #merge_spans=0,
output_xhtml=1,
- #preserve_entities=1,
quote_ampersand=0,
show_body_only=1,
char_encoding='utf8',
@@ -70,9 +68,9 @@ class CheckSyntax(object):
cfg_section = get_section(file, config)
if config.getboolean(cfg_section, 'skip'):
raise nose.plugins.skip.SkipTest, 'Test skipped per config.'
- input_file = file + ".txt"
+ input_file = file + config.get(cfg_section, 'input_ext')
input = codecs.open(input_file, encoding="utf-8").read()
- output_file = file + ".html"
+ output_file = file + config.get(cfg_section, 'output_ext')
expected_output = codecs.open(output_file, encoding="utf-8").read()
output = markdown.markdown(input, **get_args(file, config))
if tidy and config.getboolean(cfg_section, 'normalize'):
@@ -98,12 +96,14 @@ def TestSyntax():
'safe_mode': False,
'output_format': 'xhtml1',
'normalize': '0',
- 'skip': '0'})
+ 'skip': '0',
+ 'input_ext': '.txt',
+ 'output_ext': '.html'})
config.read(os.path.join(dir_name, 'test.cfg'))
# Loop through files and generate tests.
for file in files:
root, ext = os.path.splitext(file)
- if ext == '.txt':
+ if ext == config.get(get_section(file, config), 'input_ext'):
path = os.path.join(dir_name, root)
check_syntax = CheckSyntax(description=relpath(path, test_dir))
yield check_syntax, path, config