Package vobject :: Module tests
[show private | hide private]
[frames | no frames]

Module vobject.tests

Long or boring tests for vobjects.
Function Summary
  _test()

Variable Summary
dict __test__ = {'Test readOne': "\n    >>> import StringIO\n...
str badstream = 'BEGIN:VCALENDAR\nCALSCALE:GREGORIAN\nX-WR-T...
str icaltest = 'BEGIN:VCALENDAR\nCALSCALE:GREGORIAN\nX-WR-TI...
str testSilly = '\nsillyname:name\nprofile:sillyprofile\nstu...
str timezones = '\n\nBEGIN:VTIMEZONE\nTZID:US/Pacific\nBEGIN...
str vcardtest = 'BEGIN:VCARD\nVERSION:3.0\nFN:Daffy Duck Knu...
str vcardWithGroups = 'home.begin:vcard\nversion:3.0\nsource...

Variable Details

__test__

Type:
dict
Value:
{'Import icaltest': "\n    >>> import vobject, StringIO\n    >>> f = S\
tringIO.StringIO(icaltest)\n    >>> c = vobject.readOne(f, validate=Tr\
ue)\n    >>> c.vevent[0].valarm[0].trigger[0]\n    <TRIGGER{}-1 day, 0\
:00:00>\n    >>> c.vevent[0].dtstart[0].value\n    datetime.datetime(2\
002, 10, 28, 14, 0, tzinfo=<tzicalvtz 'US/Pacific'>)\n    >>> c.vevent\
[0].dtend[0].value\n    datetime.datetime(2002, 10, 28, 15, 0, tzinfo=\
<tzicalvtz 'US/Pacific'>)\n    >>> c.vevent[0].dtstamp[0].value\n    d\
atetime.datetime(2002, 10, 28, 1, 17, 6, tzinfo=tzutc())\n    >>> c.ve\
...                                                                    

badstream

Type:
str
Value:
'''BEGIN:VCALENDAR
CALSCALE:GREGORIAN
X-WR-TIMEZONE;VALUE=TEXT:US/Pacific
METHOD:PUBLISH
PRODID:-//Apple Computer\\, Inc//iCal 1.0//EN
X-WR-CALNAME;VALUE=TEXT:Example
VERSION:2.0
BEGIN:VEVENT
...                                                                    

icaltest

Type:
str
Value:
'''BEGIN:VCALENDAR
CALSCALE:GREGORIAN
X-WR-TIMEZONE;VALUE=TEXT:US/Pacific
METHOD:PUBLISH
PRODID:-//Apple Computer\\, Inc//iCal 1.0//EN
X-WR-CALNAME;VALUE=TEXT:Example
VERSION:2.0
BEGIN:VEVENT
...                                                                    

testSilly

Type:
str
Value:
'''
sillyname:name
profile:sillyprofile
stuff:folded
 line
morestuff;asinine:this line is not folded, but in practice probably ou\
ght to be, as it is exceptionally long, and moreover demonstratively s\
tupid'''                                                               

timezones

Type:
str
Value:
'''

BEGIN:VTIMEZONE
TZID:US/Pacific
BEGIN:STANDARD
DTSTART:19671029T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZOFFSETFROM:-0700
...                                                                    

vcardtest

Type:
str
Value:
'''BEGIN:VCARD
VERSION:3.0
FN:Daffy Duck Knudson (with Bugs Bunny and Mr. Pluto)
N:Knudson;Daffy Duck (with Bugs Bunny and Mr. Pluto)
NICKNAME:gnat and gnu and pluto
BDAY;value=date:02-10;11-05;01-01
TEL;type=HOME:+01-(0)2-765.43.21
TEL;type=CELL:+01-(0)5-555.55.55
...                                                                    

vcardWithGroups

Type:
str
Value:
'''home.begin:vcard
version:3.0
source:ldap://cn=Meister%20Berger,o=Universitaet%20Goerlitz,c=DE
name:Meister Berger
fn:Meister Berger
n:Berger;Meister
bday;value=date:1963-09-21
o:Universit=E6t G=F6rlitz
...                                                                    

Generated by Epydoc 2.1 on Fri Dec 14 17:25:14 2007 http://epydoc.sf.net