diff options
Diffstat (limited to 'dev-python/cssutils/files/cssutils-0.9.7-test.patch')
-rw-r--r-- | dev-python/cssutils/files/cssutils-0.9.7-test.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/dev-python/cssutils/files/cssutils-0.9.7-test.patch b/dev-python/cssutils/files/cssutils-0.9.7-test.patch new file mode 100644 index 000000000000..a93e44fa9c5a --- /dev/null +++ b/dev-python/cssutils/files/cssutils-0.9.7-test.patch @@ -0,0 +1,60 @@ +Fix some test failures. Adapted from: +https://bitbucket.org/cthedot/cssutils/changeset/c944fbd1b309 +diff -ur cssutils-0.9.7.orig/examples/customlog.py cssutils-0.9.7/examples/customlog.py +--- examples/customlog.py 2010-11-27 18:23:40.000000000 +0800 ++++ examples/customlog.py 2011-12-23 02:11:47.863908828 +0800 +@@ -1,7 +1,7 @@ + import logging, StringIO
+
+ EXPOUT = ""
+-EXPERR = u"Property: Unknown Property name. [1:5: x]\nHTTPError opening url=u'http://example.com/x': 404 Not Found\nCSSImportRule: While processing imported style sheet href=u'http://example.com/x': IOError('Cannot read Stylesheet.',)\nCSSStylesheet: CSSImportRule not allowed here. [1:13: @import]\n"
++EXPERR = u"Property: Unknown Property name. [1:5: x]\nHTTPError opening url=u'http://cthedot.de/x': 404 Not Found\nCSSImportRule: While processing imported style sheet href=u'http://cthedot.de/x': IOError('Cannot read Stylesheet.',)\nCSSStylesheet: CSSImportRule not allowed here. [1:13: @import]\n"
+
+ def main():
+ import cssutils
+@@ -12,7 +12,7 @@ + #cssutils.log.addHandler(h)
+ cssutils.log.setLevel(logging.INFO)
+
+- sheet = cssutils.parseString('a { x: 1; } @import "http://example.com/x";')
++ sheet = cssutils.parseString('a { x: 1; } @import "http://cthedot.de/x";')
+ #print mylog.getvalue()
+
+ cssutils.log.removeHandler(h)
+diff -ur cssutils-0.9.7.orig/src/tests/test_parse.py cssutils-0.9.7/src/tests/test_parse.py +--- src/tests/test_parse.py 2010-11-27 18:23:36.000000000 +0800 ++++ src/tests/test_parse.py 2011-12-23 02:24:13.419840476 +0800 +@@ -96,15 +96,15 @@ + ('', None): (False, None, None),
+ ('1', None): (False, None, None),
+ ('mailto:a@bb.cd', None): (False, None, None),
+- ('http://example.com/x.css', None): (False, None, None),
+- ('http://example.com/x.css', ''): (True, u'utf-8', u''),
+- # ('http://example.com/x.css', 'a'): (True, u'utf-8', u''),
+-# ('http://example.com/x.css', 'a {color: red}'): (True, u'utf-8',
+-# u'a {\n color: red\n }'),
+-# ('http://example.com/x.css', 'a {color: red}'): (True, u'utf-8',
+-# u'a {\n color: red\n }'),
+-# ('http://example.com/x.css', '@charset "ascii";a {color: red}'): (True, u'ascii',
+-# u'@charset "ascii";\na {\n color: red\n }'),
++ ('http://cthedot.de/test.css', None): (False, None, None),
++ ('http://cthedot.de/test.css', ''): (True, u'utf-8', u''),
++ ('http://cthedot.de/test.css', 'a'): (True, u'utf-8', u''),
++ ('http://cthedot.de/test.css', 'a {color: red}'): (True, u'utf-8',
++ u'a {\n color: red\n }'),
++ ('http://cthedot.de/test.css', 'a {color: red}'): (True, u'utf-8',
++ u'a {\n color: red\n }'),
++ ('http://cthedot.de/test.css', '@charset "ascii";a {color: red}'): (True, u'ascii',
++ u'@charset "ascii";\na {\n color: red\n }'),
+ }
+ override = 'iso-8859-1'
+ overrideprefix = u'@charset "iso-8859-1";'
+@@ -132,7 +132,7 @@ + self.assertEqual(sheet2, None)
+
+ self.assertRaises(ValueError, parser.parseUrl, '../not-valid-in-urllib')
+- self.assertRaises(urllib2.HTTPError, parser.parseUrl, 'http://example.com/not-present.css')
++ self.assertRaises(urllib2.HTTPError, parser.parseUrl, 'http://cthedot.de/not-present.css')
+
+ def test_parseString(self):
+ "CSSParser.parseString()"
|