本文整理匯總了Python中unit.ewslib_testcase.LIB.reload_page方法的典型用法代碼示例。如果您正苦於以下問題:Python LIB.reload_page方法的具體用法?Python LIB.reload_page怎麽用?Python LIB.reload_page使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類unit.ewslib_testcase.LIB
的用法示例。
在下文中一共展示了LIB.reload_page方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_verify_widget_caching_behavior
# 需要導入模塊: from unit.ewslib_testcase import LIB [as 別名]
# 或者: from unit.ewslib_testcase.LIB import reload_page [as 別名]
def test_verify_widget_caching_behavior(self):
self.navigate(data.PD_URL)
widget_id = "fwk_menu_16"
widget_name = "Related Links"
#initially widget is uncached
self.assertIsNone(LIB._is_widget_cached(widget_name))
#call with cache_widget = False and widget is Not cached
t0 = time.clock()
LIB._get_widget_by_name(widget_name, False)
uncached_retrival_time = time.clock() - t0
self.assertIsNone(LIB._is_widget_cached(widget_name))
#default - call with cach_widget = True and widget is cached
widget = LIB._get_widget_by_name(widget_name)
t1 = time.clock()
cached_widget = LIB._get_widget_by_name(widget_name)
cached_retrival_time = time.clock() - t1
self.assertEqual(widget.text, cached_widget.text)
self.assertTrue(cached_retrival_time < uncached_retrival_time)
print "Uncached retrival time = %f Cached retrival time = %f" % (uncached_retrival_time, cached_retrival_time)
#and widget id should be set to name_widget
self.assertEqual("%s_widget" % (widget_name), widget.get_attribute('id'))
#and cache should be invalidated after reload
LIB.reload_page()
self.assertIsNone(LIB._is_widget_cached(widget_name))