1 |
floppym 11/12/22 20:54:01 |
2 |
|
3 |
Added: cssutils-0.9.7-test.patch |
4 |
Log: |
5 |
Fix test failures. Patch by Ian Delaney. Bug 386807. |
6 |
|
7 |
(Portage version: 2.2.0_alpha81/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-python/cssutils/files/cssutils-0.9.7-test.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/cssutils/files/cssutils-0.9.7-test.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/cssutils/files/cssutils-0.9.7-test.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: cssutils-0.9.7-test.patch |
16 |
=================================================================== |
17 |
Fix some test failures. Adapted from: |
18 |
https://bitbucket.org/cthedot/cssutils/changeset/c944fbd1b309 |
19 |
diff -ur cssutils-0.9.7.orig/examples/customlog.py cssutils-0.9.7/examples/customlog.py |
20 |
--- examples/customlog.py 2010-11-27 18:23:40.000000000 +0800 |
21 |
+++ examples/customlog.py 2011-12-23 02:11:47.863908828 +0800 |
22 |
@@ -1,7 +1,7 @@ |
23 |
import logging, StringIO |
24 |
|
25 |
EXPOUT = "" |
26 |
-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" |
27 |
+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" |
28 |
|
29 |
def main(): |
30 |
import cssutils |
31 |
@@ -12,7 +12,7 @@ |
32 |
#cssutils.log.addHandler(h) |
33 |
cssutils.log.setLevel(logging.INFO) |
34 |
|
35 |
- sheet = cssutils.parseString('a { x: 1; } @import "http://example.com/x";') |
36 |
+ sheet = cssutils.parseString('a { x: 1; } @import "http://cthedot.de/x";') |
37 |
#print mylog.getvalue() |
38 |
|
39 |
cssutils.log.removeHandler(h) |
40 |
diff -ur cssutils-0.9.7.orig/src/tests/test_parse.py cssutils-0.9.7/src/tests/test_parse.py |
41 |
--- src/tests/test_parse.py 2010-11-27 18:23:36.000000000 +0800 |
42 |
+++ src/tests/test_parse.py 2011-12-23 02:24:13.419840476 +0800 |
43 |
@@ -96,15 +96,15 @@ |
44 |
('', None): (False, None, None), |
45 |
('1', None): (False, None, None), |
46 |
('mailto:a@××.cd', None): (False, None, None), |
47 |
- ('http://example.com/x.css', None): (False, None, None), |
48 |
- ('http://example.com/x.css', ''): (True, u'utf-8', u''), |
49 |
- # ('http://example.com/x.css', 'a'): (True, u'utf-8', u''), |
50 |
-# ('http://example.com/x.css', 'a {color: red}'): (True, u'utf-8', |
51 |
-# u'a {\n color: red\n }'), |
52 |
-# ('http://example.com/x.css', 'a {color: red}'): (True, u'utf-8', |
53 |
-# u'a {\n color: red\n }'), |
54 |
-# ('http://example.com/x.css', '@charset "ascii";a {color: red}'): (True, u'ascii', |
55 |
-# u'@charset "ascii";\na {\n color: red\n }'), |
56 |
+ ('http://cthedot.de/test.css', None): (False, None, None), |
57 |
+ ('http://cthedot.de/test.css', ''): (True, u'utf-8', u''), |
58 |
+ ('http://cthedot.de/test.css', 'a'): (True, u'utf-8', u''), |
59 |
+ ('http://cthedot.de/test.css', 'a {color: red}'): (True, u'utf-8', |
60 |
+ u'a {\n color: red\n }'), |
61 |
+ ('http://cthedot.de/test.css', 'a {color: red}'): (True, u'utf-8', |
62 |
+ u'a {\n color: red\n }'), |
63 |
+ ('http://cthedot.de/test.css', '@charset "ascii";a {color: red}'): (True, u'ascii', |
64 |
+ u'@charset "ascii";\na {\n color: red\n }'), |
65 |
} |
66 |
override = 'iso-8859-1' |
67 |
overrideprefix = u'@charset "iso-8859-1";' |
68 |
@@ -132,7 +132,7 @@ |
69 |
self.assertEqual(sheet2, None) |
70 |
|
71 |
self.assertRaises(ValueError, parser.parseUrl, '../not-valid-in-urllib') |
72 |
- self.assertRaises(urllib2.HTTPError, parser.parseUrl, 'http://example.com/not-present.css') |
73 |
+ self.assertRaises(urllib2.HTTPError, parser.parseUrl, 'http://cthedot.de/not-present.css') |
74 |
|
75 |
def test_parseString(self): |
76 |
"CSSParser.parseString()" |