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

Dmitry Shachnev mitya57 at moszumanska.debian.org
Sun Sep 25 10:58:35 UTC 2016


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

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

commit 686af3f015afb6de9a65d94deb0b920a91c5c1ed
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 adcffe4..ff2379f 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