diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2013-05-04 21:39:27 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2013-05-04 21:39:27 +0000 |
commit | fec6336699f34758d3e6cb41b2edf902fedb9035 (patch) | |
tree | 8256c1dbf3ca7c9e58a3dbecf07cf826fb2e0ce2 /src/python/test.py | |
parent | 7dbffd7e2b0067e834801617c5c486e3177f6709 (diff) | |
download | libical-master.tar.gz |
libical-1.0HEADlibical-1.0master
Diffstat (limited to 'src/python/test.py')
-rw-r--r-- | src/python/test.py | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/python/test.py b/src/python/test.py index 01c683f..1d82062 100644 --- a/src/python/test.py +++ b/src/python/test.py @@ -133,12 +133,12 @@ def test_time(): t = Time("19970325T123010Z",'DTSTART') - assert(t.year() == 1997) - assert(t.month() == 3) - assert(t.day() == 25) - assert(t.hour() == 12) - assert(t.minute() == 30) - assert(t.second() == 10) + assert(t.year == 1997) + assert(t.month == 3) + assert(t.day == 25) + assert(t.hour == 12) + assert(t.minute == 30) + assert(t.second == 10) assert(t.is_utc()) assert(not t.is_date()) @@ -148,25 +148,26 @@ def test_time(): print str(t) print t.timezone() #assert(str(t)=='DTSTART;TZID=America/Los_Angeles:19970325T123010') - assert(str(t)=='DTSTART;TZID=/softwarestudio.org/Olson_20010626_2/America/Los_Angeles:19970325T043010') + assert(str(t)=='DTSTART;TZID=/freeassociation.sourceforge.net/Tzfile/America/Los_Angeles:19970325T053010') - t.second(t.second()+80) + t.second = t.second+80 t.timezone("UTC") - assert(t.minute() == 31) - assert(t.second() == 30) + print t.minute, t.second + assert(t.minute == 31) + assert(t.second == 30) d = Duration(3600,"DURATION") t2 = t + d print t2 - assert(t2.hour() == 13) + assert(t2.hour == 13) t2 = t - d print t2 assert(isinstance(t2,Time)) - assert(t2.hour() == 11) + assert(t2.hour == 11) # test int args t = Time(2) @@ -297,13 +298,13 @@ def test_component(): print dtstart - print "\n Orig hour: ", dtstart.hour() - assert(dtstart.hour() == 12) + print "\n Orig hour: ", dtstart.hour + assert(dtstart.hour == 12) - dtstart.hour(dtstart.hour() + 5) + dtstart.hour = dtstart.hour + 5 - print "\n New hour: ", dtstart.hour() - assert(dtstart.hour() == 17) + print "\n New hour: ", dtstart.hour + assert(dtstart.hour == 17) attendee = inner.properties('ATTENDEE')[0] @@ -496,7 +497,7 @@ def do_test_store(storeobj=None, *args): for i in range(1,11): newevent = event.clone() newevent.uid("%d@localhost" % (i,)) - newevent.dtstart().month( newevent.dtstart().month() + i ) + newevent.dtstart().month = newevent.dtstart().month + i #print ne store.add_component(newevent) @@ -575,6 +576,8 @@ def test_store(): do_test_store(FileStore,"filesetout.ics") def run_tests(): + print "Running unit tests for:", ICAL_PACKAGE, ICAL_VERSION + test_property() test_time() |