Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 204557 Details for
Bug 280365
>=dev-python/gdata-2.0.0: atom_tests.core_test.CharacterEncodingTest.testOtherEncodingOnInputString fails on big-endian architectures
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
gdata-big_endian_tests.patch
gdata-big_endian_tests.patch (text/plain), 1.44 KB, created by
Arfrever Frehtes Taifersar Arahesis (RETIRED)
on 2009-09-19 01:35:07 UTC
(
hide
)
Description:
gdata-big_endian_tests.patch
Filename:
MIME Type:
Creator:
Arfrever Frehtes Taifersar Arahesis (RETIRED)
Created:
2009-09-19 01:35:07 UTC
Size:
1.44 KB
patch
obsolete
>--- tests/atom_tests/core_test.py >+++ tests/atom_tests/core_test.py >@@ -398,6 +398,8 @@ > self.assertTrue(x.to_string().startswith('<x a="δ"')) > > def testOtherEncodingOnInputString(self): >+ BIG_ENDIAN = 0 >+ LITTLE_ENDIAN = 1 > # Test parsing inner text. > self.assertEqual(parse(u'<x>\u03b4</x>'.encode('utf-16')).text, u'\u03b4') > >@@ -409,12 +411,21 @@ > e = create('x', u'\u03b4'.encode('utf-16')) > self.assertEqual(e.to_string(encoding='utf-16'), '<x>δ</x>') > # Don't change the encoding until the we convert to an XML string. >- self.assertEqual(e.text, '\xff\xfe\xb4\x03') >+ # Allow either little-endian or big-endian byte orderings. >+ self.assertTrue(e.text in ['\xff\xfe\xb4\x03', '\xfe\xff\x03\xb4']) >+ endianness = LITTLE_ENDIAN >+ if e.text == '\xfe\xff\x03\xb4': >+ endianness = BIG_ENDIAN > self.assertTrue(isinstance(e.text, str)) > self.assertTrue(isinstance(e.to_string(encoding='utf-16'), str)) >- self.assertEqual( >- create('x', '\xff\xfe\xb4\x03').to_string(encoding='utf-16'), >- '<x>δ</x>') >+ if endianness == LITTLE_ENDIAN: >+ self.assertEqual( >+ create('x', '\xff\xfe\xb4\x03').to_string(encoding='utf-16'), >+ '<x>δ</x>') >+ else: >+ self.assertEqual( >+ create('x', '\xfe\xff\x03\xb4').to_string(encoding='utf-16'), >+ '<x>δ</x>') > > def testOtherEncodingInTagsAndAttributes(self): > self.assertEqual(
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 280365
:
201496
|
201626
|
201628
|
202840
| 204557 |
204775