mò %U²Ic@sšdkZdkZdkZdklZydklZWn ej odklZnXdeifd„ƒYZ d„Z e djo e ƒndS(N(s test_support(sStringIOtMessageTestCasecBs˜tZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„ZRS(NcCstit|ƒƒS(N(trfc822tMessagetStringIOtmsg(tselfR((t-/data/zmath/lib/python2.4/test/test_rfc822.pytcreate_message scCs†|idƒ}|i|idƒdjƒ|i|idƒdjƒ|i|idƒdjƒ|i|iddƒdjƒdS(Ns)To: "last, first" test ttos"last, first" tTOsNo-Such-Headers No-Such-Value(RRRtassert_tgettNone(RR((Rttest_gets cCs²|idƒ}|i|idƒ ƒ|i|iddƒdjƒ|i|iddƒdjƒ|i|ddjƒ|i|idƒdjƒ|i|ddjƒdS( Ns)To: "last, first" test s New-Headers New-ValuesDifferent-Values new-headersAnother-Headertsanother-header(RRRR thas_keyt setdefault(RR((Rttest_setdefaultsc CsE|i|ƒ}d}xü|idƒ|idƒD]Þ\}}y!||d||d}}Wn/t j o#dGt |ƒGt |ƒGHq2nX|d}|i ||d| | fƒ|i ||d| | fƒ||jo||joq2dGt |ƒGt |ƒGHq2W|id ƒ} | o|i | ddƒndS(sCheck addresses and the date.iRtccisextra parsed address:sUn-expected name: %s != %ssUn-expected address: %s != %ss not found:tdateiÏi ii9i#sdate conversion failedN( iÏii ii9i#iii(RRRtmtit getaddrlisttntatresultstmntmat IndexErrortreprt assertEqualtgetdatetout( RRRRRRRRRR ((Rtcheck%s. !    c Cs›|iddgƒ|iddgƒ|idddgƒ|iddgƒ|id d d!d"d#d$d%gƒ|idd&gƒ|idd'gƒdS((Ns¦Date: Wed, 13 Jan 1999 23:57:35 -0500 From: Guido van Rossum To: "Guido van : Rossum" Subject: test2 test2 sGuido van : Rossumsguido@python.orgs“From: Barry Date: 13-Jan-1999 23:57:35 EST testsGuido: the MadmanswTo: "The monster with the very long name: Guido" Date: Wed, 13 Jan 1999 23:57:35 -0500 tests/The monster with the very long name: GuidosôTo: "Amit J. Patel" CC: Mike Fletcher , "'string-sig@python.org'" Cc: fooz@bat.com, bart@toof.com Cc: goit@lip.com Date: Wed, 13 Jan 1999 23:57:35 -0500 tests Amit J. Patelsamitp@Theory.Stanford.EDUs Mike Fletchersmfletch@vrtelecom.coms'string-sig@python.org'sstring-sig@python.orgRs fooz@bat.coms bart@toof.coms goit@lip.comsVTo: Some One From: Anudder Persin Date: testsSome Onessomeone@dom.ains%To: person@dom.ain (User J. Person) sUser J. Personsperson@dom.ain(sGuido van : Rossumsguido@python.org(sGuido: the Barbariansguido@python.org(sGuido: the Barbariansguido@python.org(sGuido: the Madmansguido@python.org(s/The monster with the very long name: Guidosguido@python.org(s Amit J. Patelsamitp@Theory.Stanford.EDU(s Mike Fletchersmfletch@vrtelecom.com(s'string-sig@python.org'sstring-sig@python.org(Rs fooz@bat.com(Rs bart@toof.com(Rs goit@lip.com(sSome Onessomeone@dom.ain(sUser J. Personsperson@dom.ain(RR!(R((Rt test_basicCs            cCs|idddgƒdS(Ns?To: person@dom.ain ((User J. Person)), John Doe sUser J. Personsperson@dom.ainsJohn Does foo@bar.com(sUser J. Personsperson@dom.ain(sJohn Does foo@bar.com(RR!(R((Rttest_doublecommentˆs cCs|iddddgƒdS(NsrTo: <[smtp:dd47@mail.xxx.edu]_at_hmhq@hdq-mdm1-imgout.companay.com> Date: Wed, 13 Jan 1999 23:57:35 -0500 testRsdd47@mail.xxx.edus%_at_hmhq@hdq-mdm1-imgout.companay.com(RR(Rsdd47@mail.xxx.edu(Rs%_at_hmhq@hdq-mdm1-imgout.companay.com(RR!(R((Rt test_twistedŽs cCs|iddgƒdS(Ns(To: "last, first" tests last, firstsuserid@foo.net(s last, firstsuserid@foo.net(RR!(R((Rttest_commas_in_full_nameœs cCs|iddgƒdS(Ns5To: (Comment stuff) "Quoted name"@somewhere.com tests Comment stuffs"Quoted name"@somewhere.com(s Comment stuffs"Quoted name"@somewhere.com(RR!(R((Rttest_quoted_name¦s cCs|iddgƒdS(NsETo: : Cc: goit@lip.com Date: Wed, 13 Jan 1999 23:57:35 -0500 testRs goit@lip.com(Rs goit@lip.com(RR!(R((Rttest_bogus_to_header­s cCs|iddgƒdS(NsTo: guido@[132.151.1.21] fooRsguido@[132.151.1.21](Rsguido@[132.151.1.21](RR!(R((Rttest_addr_ipquad¶s cCs;titdƒƒ}|it|ƒddddgƒdS(Ns¦Date: Wed, 13 Jan 1999 23:57:35 -0500 From: Guido van Rossum To: "Guido van : Rossum" Subject: test2 test2 RtfromtsubjectR(RRRRRRtsorted(RR((Rt test_iter½scCs|iddgƒdS(Ns%To: User J. Person sUser J. Personsperson@dom.ain(sUser J. Personsperson@dom.ain(RR!(R((Rttest_rfc2822_phrasesÈs cCs˜|i}|idƒ}g}dddgD]}|d|fq,~}|idƒ}|i ƒ|||ƒ|idƒ}|i ƒ|||ƒdS(NsaTo: aperson@dom.ain Cc: bperson@dom.ain Cc: cperson@dom.ain Cc: dperson@dom.ain A test message. sbperson@dom.ainscperson@dom.ainsdperson@dom.ainRR( RRteqRRt_[1]RtccsRtaddrstsort(RRR0R/R1RR.((Rttest_2getaddrlistÙs 0   cCse|i}|tidƒd ƒ|tidƒd ƒ|tidƒd ƒ|tidƒd ƒdS(Ns<>Rsaperson@dom.ainsbperson@dom.ain (Bea A. Person)s Bea A. Personsbperson@dom.ains Cynthia Person sCynthia Personscperson@dom.ain(RR(Rsaperson@dom.ain(s Bea A. Personsbperson@dom.ain(sCynthia Personscperson@dom.ain(RRR.Rt parseaddr(RR.((Rttest_parseaddrís cCs9|i}|tidƒdƒ|tidƒdƒdS(Nsfoo\wacky"namesfoo\\wacky\"names"foo\\wacky\"name"(RRR.Rtquotetunquote(RR.((Rttest_quote_unquoteös (t__name__t __module__RR RR!R"R#R$R%R&R'R(R,R-R3R5R8(((RR s    E       cCstitƒdS(N(t test_supportt run_unittestR(((Rt test_mainüst__main__( RtsystunittestttestR;t cStringIORt ImportErrortTestCaseRR=R9(R;RR@RR?R=R((Rt?s    ð