[Python-modules-commits] [python-tidylib] 01/05: Make the tests pass with tidylib 5, fixes #13

Mattia Rizzolo mattia at debian.org
Tue Sep 13 08:36:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository python-tidylib.

commit ff454c0115a676fc3dfb0dad5c98d47c78121b8d
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Sat Aug 27 23:48:06 2016 +0300

    Make the tests pass with tidylib 5, fixes #13
---
 tests/test_docs.py      | 8 ++++----
 tests/test_fragments.py | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/test_docs.py b/tests/test_docs.py
index 45ced58..428feea 100644
--- a/tests/test_docs.py
+++ b/tests/test_docs.py
@@ -48,20 +48,20 @@ class TestDocs1(unittest.TestCase):
 
     def test_alt_added_to_img(self):
         h = "<img src='foo'>"
-        expected = DOC % '''<img src='foo' alt="">'''
-        doc, err = tidy_document(h)
+        expected = DOC % '''<img src='foo' alt="bar">'''
+        doc, err = tidy_document(h, {'alt-text': 'bar'})
         self.assertEqual(doc, expected)
 
     def test_entity_preserved_using_bytes(self):
         h = b"é"
         expected = (DOC % "é").encode('utf-8')
-        doc, err = tidy_document(h)
+        doc, err = tidy_document(h, {'preserve-entities': 1})
         self.assertEqual(doc, expected)
 
     def test_numeric_entities_using_bytes(self):
         h = b"é"
         expected = (DOC % "é").encode('utf-8')
-        doc, err = tidy_document(h, {'numeric-entities': 1})
+        doc, err = tidy_document(h, {'numeric-entities': 1, 'output-encoding': 'ascii'})
         self.assertEqual(doc, expected)
 
     def test_non_ascii_preserved(self):
diff --git a/tests/test_fragments.py b/tests/test_fragments.py
index dcc7a3a..c329e15 100644
--- a/tests/test_fragments.py
+++ b/tests/test_fragments.py
@@ -36,20 +36,20 @@ class TestFrags1(unittest.TestCase):
 
     def test_alt_added_to_img(self):
         h = "<img src='foo'>"
-        expected = '''<img src='foo' alt="">'''
-        doc, err = tidy_fragment(h)
+        expected = '''<img src='foo' alt="bar">'''
+        doc, err = tidy_fragment(h, {'alt-text': 'bar'})
         self.assertEqual(doc, expected)
 
     def test_entity_preserved_using_bytes(self):
         h = b"é"
         expected = b"é"
-        doc, err = tidy_fragment(h)
+        doc, err = tidy_fragment(h, {'preserve-entities': 1})
         self.assertEqual(doc, expected)
 
     def test_numeric_entities_using_bytes(self):
         h = b"é"
         expected = b"é"
-        doc, err = tidy_fragment(h, {'numeric-entities': 1})
+        doc, err = tidy_fragment(h, {'numeric-entities': 1, 'output-encoding': 'ascii'})
         self.assertEqual(doc, expected)
 
     def test_non_ascii_preserved(self):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-tidylib.git



More information about the Python-modules-commits mailing list