Title: [commits] (dan) [11252] change new framework tests to reflect recent changes current framework tests
Revision
11252
Author
dan
Date
2006-07-25 11:08:50 -0700 (Tue, 25 Jul 2006)

Log Message

change new framework tests to reflect recent changes current framework tests

Modified Paths

Diff

Modified: trunk/chandler/tools/cats/Functional/TestSwitchTimezone.py (11251 => 11252)

--- trunk/chandler/tools/cats/Functional/TestSwitchTimezone.py	2006-07-25 18:04:04 UTC (rev 11251)
+++ trunk/chandler/tools/cats/Functional/TestSwitchTimezone.py	2006-07-25 18:08:50 UTC (rev 11252)
@@ -16,16 +16,19 @@
 from tools.cats.framework.ChandlerTestCase import ChandlerTestCase
 
 from PyICU import ICUtzinfo
+from osaf.pim.calendar.TimeZone import TimeZoneInfo
 
 class TestSwitchTimezone(ChandlerTestCase):
 
     def startTest(self):
         
-        originalTz = ICUtzinfo.default.tzid
+        calendarBlock = getattr(self.app_ns, "MainCalendarControl")
+    
+        # Find the "canonical timezone" to use in test comparisons
+        info = TimeZoneInfo.get(self.app_ns.itsView)
+        originalTz = info.canonicalTimeZone(ICUtzinfo.default).tzid
         switchTz = "US/Hawaii"
     
-        calendarBlock = getattr(self.app_ns, "MainCalendarControl")
-    
         # Enable timezones so that we can switch from the UI
         self.app_ns.root.EnableTimezones()
     

Modified: trunk/chandler/tools/cats/Performance/xPerfLargeDataSwitchTimezone.py (11251 => 11252)

--- trunk/chandler/tools/cats/Performance/xPerfLargeDataSwitchTimezone.py	2006-07-25 18:04:04 UTC (rev 11251)
+++ trunk/chandler/tools/cats/Performance/xPerfLargeDataSwitchTimezone.py	2006-07-25 18:08:50 UTC (rev 11252)
@@ -32,8 +32,8 @@
         self.app_ns.root.SelectedDateChanged(start=testdate)
     
         # Load a large calendar
-        testView = QAUITestAppLib.UITestView(self.logger)#, u'Generated3000.ics')
-        self.app_ns.sidebar.select(testView.collection)
+        testView = QAUITestAppLib.UITestView(logger)#, u'Generated3000.ics')
+        clickSucceeded = self.scripting.User.User.emulate_sidebarClick(app_ns().sidebar, "Generated3000",overlay=False)
         self.scripting.User.idle()
     
         # Switch the timezone (this is the action we are measuring)
@@ -47,46 +47,10 @@
         # @@@ KCP this test could be improved
         # Currently tests that the default tz is now US/Hawaii
         self.logger.start("verify Timezone switched")
-        if ICUtzinfo.default == ICUtzinfo.getInstance("US/Hawaii"):
-            self.logger.endAction(True, "Timezone switched")
+        if clickSucceeded:
+            self.logger.endAction(True, "Selected large data calendar")
         else:
-            self.logger.endAction(False, "Timezone failed to switch")
+            self.logger.endAction(False, "Failed to select large data calendar")
         
-#import tools.cats.framework.ChandlerTestLib as QAUITestAppLib
 
-#from datetime import datetime
-#from PyICU import ICUtzinfo
-
-#try:
-    #self.app_ns = self.self.app_ns()
-    #calendarBlock = getattr(self.app_ns, "MainCalendarControl")
-
-    ## Enable timezones so that we can switch from the UI
-    #self.app_ns.root.EnableTimezones()
     
-    ## Start at the same date every time
-    #testdate = datetime(2005, 11, 27, tzinfo=ICUtzinfo.default)
-    #self.app_ns.root.SelectedDateChanged(start=testdate)
-
-    ## Load a large calendar
-    #testView = QAUITestAppLib.UITestView(self.logger, "office.ics")#, u'Generated3000.ics')
-    #self.app_ns.sidebar.select(testView.collection)
-    #self.scripting.User.idle()
-
-    ## Switch the timezone (this is the action we are measuring)
-    #self.logger.startAction("Switch timezone to US/Hawaii")
-    #QAUITestAppLib.SetChoice(calendarBlock.widget.tzChoice, "US/Hawaii")
-    #self.scripting.User.idle()
-    #self.logger.endAction()
-
-    ## Verification
-
-    ## @@@ KCP this test could be improved
-    ## Currently tests that the default tz is now US/Hawaii
-    #self.logger.startAction("verify timezone changed to US/Hawaii")
-    #if ICUtzinfo.default == ICUtzinfo.getInstance("US/Hawaii"):
-        #self.logger.endAction(True, "Timezone switched")
-    #else:
-        #self.logger.endAction(False, "Timezone failed to switch")
-    
-    




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to