aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2014-08-21 10:06:47 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2014-08-21 10:06:47 -0400
commitd620a31e1eb9ea529fcdf5d64419eda60d2b407e (patch)
tree0ce22901b1766386ea6449d02510c4a31931341c
parent1895fb4a35f6823aa32da452c1a4c22694e9c19f (diff)
downloadmarkdown-d620a31e1eb9ea529fcdf5d64419eda60d2b407e.tar.gz
markdown-d620a31e1eb9ea529fcdf5d64419eda60d2b407e.tar.bz2
markdown-d620a31e1eb9ea529fcdf5d64419eda60d2b407e.zip
Updated generate code for tests refactor. Related to #333.
-rwxr-xr-xrun-tests.py2
-rw-r--r--tests/__init__.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/run-tests.py b/run-tests.py
index 1185e2d..2727a20 100755
--- a/run-tests.py
+++ b/run-tests.py
@@ -7,7 +7,7 @@ if len(sys.argv) > 1 and sys.argv[1] == "update":
if len(sys.argv) > 2:
config = tests.get_config(os.path.dirname(sys.argv[2]))
root, ext = os.path.splitext(sys.argv[2])
- if ext == config.get(tests.get_section(os.path.basename(root), config), 'input_ext'):
+ if ext == config.get(config.get_section(os.path.basename(root)), 'input_ext'):
tests.generate(root, config)
else:
print(sys.argv[2], 'does not have a valid file extension. Check config.')
diff --git a/tests/__init__.py b/tests/__init__.py
index a56f196..15710ac 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -136,7 +136,7 @@ def TestSyntax():
def generate(file, config):
""" Write expected output file for given input. """
- cfg_section = get_section(file, config)
+ cfg_section = config.get_section(file)
if config.get(cfg_section, 'skip') or config.get(cfg_section, 'normalize'):
print('Skipping:', file)
return None
@@ -146,7 +146,7 @@ def generate(file, config):
os.path.getmtime(output_file) < os.path.getmtime(input_file):
print('Generating:', file)
markdown.markdownFromFile(input=input_file, output=output_file,
- encoding='utf-8', **get_args(file, config))
+ encoding='utf-8', **config.get_args(file))
else:
print('Already up-to-date:', file)
@@ -158,7 +158,7 @@ def generate_all():
# Loop through files and generate tests.
for file in files:
root, ext = os.path.splitext(file)
- if ext == config.get(get_section(file, config), 'input_ext'):
+ if ext == config.get(config.get_section(file), 'input_ext'):
generate(os.path.join(dir_name, root), config)