[libical-glib] Update the tests in favor of libical-2.0.0 (unreleased)



commit 8c15d77a5c59566ad4fdd743aa124d4c7aae6ff5
Author: William Yu <willyu86 gmail com>
Date:   Sun Apr 26 09:53:06 2015 -0400

    Update the tests in favor of libical-2.0.0 (unreleased)

 tests/recurrence-type.py |   20 +++++++++++++-------
 tests/timezone.py        |    2 +-
 2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/tests/recurrence-type.py b/tests/recurrence-type.py
index 835b92b..dfd9622 100755
--- a/tests/recurrence-type.py
+++ b/tests/recurrence-type.py
@@ -35,23 +35,29 @@ recurrence = ICalGLib.RecurrenceType.from_string (string);
 assert (recurrence.as_string_r() == "FREQ=DAILY;COUNT=10");
 
 by_second = recurrence.get_by_second();
-assert len(by_second) == 61;
+# The value is dependent on the libical version.
+assert len(by_second) == 61 or len(by_second) == 62;
 by_minute = recurrence.get_by_minute();
 assert len(by_minute) == 61;
 by_hour = recurrence.get_by_hour();
 assert len(by_hour) == 25;
 by_day = recurrence.get_by_day();
-assert len(by_day) == 364;
+# The value is dependent on the libical version.
+assert len(by_day) == 364 or len(by_day) == 386;
 by_month_day = recurrence.get_by_month_day();
 assert len(by_month_day) == 32;
 by_year_day = recurrence.get_by_year_day();
-assert len(by_year_day) == 367;
+# The value is dependent on the libical version.
+assert len(by_year_day) == 367 or len(by_year_day) == 386;
 by_week_no = recurrence.get_by_week_no();
-assert len(by_week_no) == 54;
+# The value is dependent on the libical version.
+assert len(by_week_no) == 54 or len(by_week_no) == 56;
 by_month = recurrence.get_by_month();
-assert len(by_month) == 13;
+# The value is dependent on the libical version.
+assert len(by_month) == 13 or len(by_month) == 14;
 by_set_pos = recurrence.get_by_set_pos();
-assert len(by_set_pos) == 367;
+# The value is dependent on the libical version.
+assert len(by_set_pos) == 367 or len(by_set_pos) == 386;
 
 recurrence.set_by_second(0, 1);
 by_second = recurrence.get_by_second();
@@ -82,4 +88,4 @@ while day != 0:
     ref += 1;
     timetype = iter.next();
     day = timetype.get_day();
-    
\ No newline at end of file
+    
diff --git a/tests/timezone.py b/tests/timezone.py
index ab9df14..4565b6f 100755
--- a/tests/timezone.py
+++ b/tests/timezone.py
@@ -23,7 +23,7 @@ from gi.repository import ICalGLib
 
 la = ICalGLib.Timezone.get_builtin_timezone ("America/Los_Angeles");
 chicago = ICalGLib.Timezone.get_builtin_timezone ("America/Chicago");
-assert la.get_tzid() == "/freeassociation.sourceforge.net/Tzfile/America/Los_Angeles";
+assert la.get_tzid().find ("Los_Angeles") != -1;
 assert la.get_location() == "America/Los_Angeles";
 assert la.get_tznames() == "PST/PDT";
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]