deliberately test the ISO-8859-1 file

This commit is contained in:
Martin A. Brown 2016-04-02 12:15:55 -07:00
parent d922c04d02
commit 7904944e09
1 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,13 @@ import example
from tldp.typeguesser import guess
from tldp.doctypes.common import SignatureChecker
# -- shorthand
opj = os.path.join
opd = os.path.dirname
opa = os.path.abspath
sampledocs = opj(opd(__file__), 'sample-documents')
def genericGuessTest(content, ext):
tf = ntf(prefix='tldp-guesser-test-', suffix=ext, delete=False)
@ -27,6 +34,10 @@ def genericGuessTest(content, ext):
class TestDoctypes(unittest.TestCase):
def testISO_8859_1(self):
dt = guess(opj(sampledocs, 'ISO-8859-1.sgml'))
self.assertIsNotNone(dt)
def testDetectionBySignature(self):
for ex in example.sources:
if isinstance(ex.doctype, SignatureChecker):