Your IP : 216.73.216.103


Current Path : /lib64/python2.7/test/
Upload Files:
Current File: //lib64/python2.7/test/test_plistlib.pyc

�
zfc@s�ddlZddlZddlZddlZddlmZdjdd�ZdZdej	fd	��YZ
d
�Zedkr�e�ndS(
i����N(ttest_supports<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>aDate</key>
        <date>2004-10-26T10:33:33Z</date>
        <key>aDict</key>
        <dict>
                <key>aFalseValue</key>
                <false/>
                <key>aTrueValue</key>
                <true/>
                <key>aUnicodeValue</key>
                <string>Mässig, Maß</string>
                <key>anotherString</key>
                <string>&lt;hello &amp; 'hi' there!&gt;</string>
                <key>deeperDict</key>
                <dict>
                        <key>a</key>
                        <integer>17</integer>
                        <key>b</key>
                        <real>32.5</real>
                        <key>c</key>
                        <array>
                                <integer>1</integer>
                                <integer>2</integer>
                                <string>text</string>
                        </array>
                </dict>
        </dict>
        <key>aFloat</key>
        <real>0.5</real>
        <key>aList</key>
        <array>
                <string>A</string>
                <string>B</string>
                <integer>12</integer>
                <real>32.5</real>
                <array>
                        <integer>1</integer>
                        <integer>2</integer>
                        <integer>3</integer>
                </array>
        </array>
        <key>aString</key>
        <string>Doodah</string>
        <key>anInt</key>
        <integer>728</integer>
        <key>nestedData</key>
        <array>
                <data>
                PGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5r
                PgABAgM8bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5
                IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5rPgABAgM8bG90cyBvZiBi
                aW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3Rz
                IG9mIGJpbmFyeSBndW5rPgABAgM8bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQID
                PGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAw==
                </data>
        </array>
        <key>someData</key>
        <data>
        PGJpbmFyeSBndW5rPg==
        </data>
        <key>someMoreData</key>
        <data>
        PGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5rPgABAgM8
        bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxs
        b3RzIG9mIGJpbmFyeSBndW5rPgABAgM8bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxv
        dHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5rPgABAgM8bG90
        cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAw==
        </data>
        <key>Åbenraa</key>
        <string>That was a unicode key.</string>
</dict>
</plist>
t is	s<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd" [
   <!ENTITY entity "replacement text">
  ]>
<plist version="1.0">
  <dict>
    <key>A</key>
    <string>&entity;</string>
  </dict>
</plist>
tTestPlistlibcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�ZRS(cCs"ytjtj�WnnXdS(N(tostunlinkRtTESTFN(tself((s*/usr/lib64/python2.7/test/test_plistlib.pyttearDowniscCs�tddddddddd	d
ggddd
ddtdddddtdtdtddddddd	dg��dtjd�dtjdd �d!tjdd �gd"tjd#d d$d d%d%��	}d&|d'<|S((NtaStringtDoodahtaListtAtBig@@@iiitaFloatg�?tanInti�taDictt
anotherStrings<hello & 'hi' there!>t
aUnicodeValueu
Mässig, Maßt
aTrueValuetaFalseValuet
deeperDicttaitbtcttexttsomeDatas
<binary gunk>tsomeMoreDatas<lots of binary gunk>i
t
nestedDatataDatei�ii!sThat was a unicode key.uÅbenraa(tdicttTruetFalsetplistlibtDatatdatetime(Rtpl((s*/usr/lib64/python2.7/test/test_plistlib.pyt_createos"'!
cCs<|j�}|j|dd�|j|ddt�dS(NRR	RR(R$tassertEqualR(RR#((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_create�scCsQ|j�}tj|tj�tjtj�}|jt|�t|��dS(N(R$R t
writePlistRRt	readPlistR%R(RR#tpl2((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_io�scCsi|j�}tj|�}tj|�}|jt|�t|��tj|�}|j||�dS(N(R$R twritePlistToStringtreadPlistFromStringR%R(RR#tdataR)tdata2((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_string�scCsTitjd�d6gggggggg}|jtjtj|��|�dS(Ntaaaaaattest(R R!R%R,R+(RR-((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_indentation_array�s.cCstiiiiiiiiitjd�d6d6d6d6d6d6d6d	6d
6}|jtjtj|��|�dS(NR0t9t8t7t6t5t4t3t2t1(R R!R%R,R+(RR-((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_indentation_dict�sNcCsciiiitjd�d6gggggd6gd6d6}|jtjtj|��|�dS(NR0R1R9R:R;(R R!R%R,R+(RR-((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_indentation_dict_mix�s=cCs5tjt�}tj|�}|j|td�dS(Ns2generated data was not identical to Apple's output(R R,tTESTDATAR+R%(RR#R-((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_appleformatting�scCs>|j�}tjt�}|jt|�t|�d�dS(Ns2generated data was not identical to Apple's output(R$R R,R>R%R(RR#R)((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_appleformattingfromliteral�scCspddlm}|�}|j�}tj||�tj||j���}|jt|�t|��dS(Ni����(tStringIO(RAR$R R'R(tgetvalueR%R(RRAtfR#R)((s*/usr/lib64/python2.7/test/test_plistlib.pyt
test_stringio�s	cCspddlm}|�}|j�}tj||�tj||j���}|jt|�t|��dS(Ni����(RA(	t	cStringIORAR$R R'R(RBR%R(RRARCR#R)((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_cstringio�s	cCsoxhtd�D]Z}t|�}d|}|dksA|dkrQtj|�q
|jttj|�q
WdS(Ni�sstring containing %si s
	(trangetchrR R+tassertRaisest
ValueError(RtiRt
testString((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_controlcharacters�s
	cCsld}ddddg}tjtj|��}tjtj|��}|j||�|j||�dS(Ntabciii(R R,R+R%(Rttest1ttest2tresult1tresult2((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_nondictroot�scCs-|jtjd��tjt�WdQXdS(Ns)XML entity declarations are not supported(tassertRaisesRegexpR tInvalidFileExceptionR,tXML_PLIST_WITH_ENTITY(R((s*/usr/lib64/python2.7/test/test_plistlib.pyttest_xml_plist_with_entity_decl�s
(t__name__t
__module__RR$R&R*R/R2R<R=R?R@RDRFRMRSRW(((s*/usr/lib64/python2.7/test/test_plistlib.pyRgs														cCstjt�dS(N(Rtrun_unittestR(((s*/usr/lib64/python2.7/test/test_plistlib.pyt	test_main�st__main__s        (
tunittestR RR"R1RtreplaceR>RVtTestCaseRR[RX(((s*/usr/lib64/python2.7/test/test_plistlib.pyt<module>sP
r