Skip to content

Commit b837a90

Browse files
author
James Graham
committed
Clean up a function name that confuses nose
1 parent 918027c commit b837a90

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

html5lib/tests/support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
except ImportError:
6363
pass
6464

65-
def html5lib_test_files(subdirectory, files='*.dat'):
65+
def get_data_files(subdirectory, files='*.dat'):
6666
return glob.glob(os.path.join(test_dir,subdirectory,files))
6767

6868
class DefaultDict(dict):

html5lib/tests/test_encoding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import unittest
3-
from support import html5lib_test_files, TestData, test_dir
3+
from support import get_data_files, TestData, test_dir
44

55
from html5lib import HTMLParser, inputstream
66

@@ -14,7 +14,7 @@ def test_codec_name(self):
1414
self.assertEquals(inputstream.codecName("ISO_8859--1"), "windows-1252")
1515

1616
def buildTestSuite():
17-
for filename in html5lib_test_files("encoding"):
17+
for filename in get_data_files("encoding"):
1818
test_name = os.path.basename(filename).replace('.dat',''). \
1919
replace('-','')
2020
tests = TestData(filename, "data")

html5lib/tests/test_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
warnings.simplefilter("error")
99

10-
from support import html5lib_test_files as data_files
10+
from support import get_data_files
1111
from support import TestData, convert, convertExpected
1212
import html5lib
1313
from html5lib import html5parser, treebuilders, constants
@@ -115,7 +115,7 @@ def runParserTest(innerHTML, input, expected, errors, treeClass,
115115

116116
def test_parser():
117117
sys.stderr.write('Testing tree builders '+ " ".join(treeTypes.keys()) + "\n")
118-
files = data_files('tree-construction')
118+
files = get_data_files('tree-construction')
119119

120120
for filename in files:
121121
testName = os.path.basename(filename).replace(".dat","")

html5lib/tests/test_serializer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import unittest
3-
from support import html5lib_test_files
3+
from support import get_data_files
44

55
try:
66
import json
@@ -170,7 +170,7 @@ def testEntityNoResolve(self):
170170
self.assertEquals(u"""<!DOCTYPE html SYSTEM "about:legacy-compat"><html>&beta;</html>""", result)
171171

172172
def test_serializer():
173-
for filename in html5lib_test_files('serializer', '*.test'):
173+
for filename in get_data_files('serializer', '*.test'):
174174
tests = json.load(file(filename))
175175
test_name = os.path.basename(filename).replace('.test','')
176176
for index, test in enumerate(tests['tests']):

html5lib/tests/test_tokenizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
except ImportError:
1010
import simplejson as json
1111

12-
from support import html5lib_test_files
12+
from support import get_data_files
1313
from html5lib.tokenizer import HTMLTokenizer
1414
from html5lib import constants
1515

@@ -141,7 +141,7 @@ def runTokenizerTest(test):
141141
#XXX - move this out into the setup function
142142
#concatenate all consecutive character tokens into a single token
143143
if 'doubleEscaped' in test:
144-
test = unescape_test(test)
144+
test = unescape(test)
145145

146146
expected = concatenateCharacterTokens(test['output'])
147147
if 'lastStartTag' not in test:
@@ -174,7 +174,7 @@ def capitalize(s):
174174
return s
175175

176176
def testTokenizer():
177-
for filename in html5lib_test_files('tokenizer', '*.test'):
177+
for filename in get_data_files('tokenizer', '*.test'):
178178
tests = json.load(file(filename))
179179
testName = os.path.basename(filename).replace(".test","")
180180
if 'tests' in tests:

html5lib/tests/test_treewalkers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
warnings.simplefilter("error")
77

8-
from support import html5lib_test_files, TestData, convertExpected
8+
from support import get_data_files, TestData, convertExpected
99

1010
from html5lib import html5parser, treewalkers, treebuilders, constants
1111
from html5lib.filters.lint import Filter as LintFilter, LintError
@@ -293,7 +293,7 @@ def test_treewalker():
293293
sys.stdout.write('Testing tree walkers '+ " ".join(treeTypes.keys()) + "\n")
294294

295295
for treeName, treeCls in treeTypes.iteritems():
296-
files = html5lib_test_files('tree-construction')
296+
files = get_data_files('tree-construction')
297297
for filename in files:
298298
testName = os.path.basename(filename).replace(".dat","")
299299

html5lib/tests/tokenizertotree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def main(out_path):
1717
sys.stderr.write("Path %s does not exist"%out_path)
1818
sys.exit(1)
1919

20-
for filename in support.html5lib_test_files('tokenizer', '*.test'):
20+
for filename in support.get_data_files('tokenizer', '*.test'):
2121
run_file(filename, out_path)
2222

2323
def run_file(filename, out_path):

0 commit comments

Comments
 (0)