Merge "Replace 'raise AssertionError' with 'self.assertIn'"

This commit is contained in:
Jenkins 2015-03-24 07:03:58 +00:00 committed by Gerrit Code Review
commit d9b0880fec
2 changed files with 5 additions and 5 deletions

View File

@ -12,9 +12,10 @@
import selenium.common.exceptions as Exceptions
import selenium.webdriver.support.ui as Support
from selenium.webdriver.support import wait
import unittest
class BaseWebObject(object):
class BaseWebObject(unittest.TestCase):
"""Base class for all web objects."""
def __init__(self, driver, conf):
self.driver = driver

View File

@ -27,10 +27,9 @@ class PageObject(basewebobject.BaseWebObject):
return self.driver.title
def is_the_current_page(self):
if self._page_title not in self.page_title:
raise AssertionError(
"Expected to find %s in page title, instead found: %s"
% (self._page_title, self.page_title))
self.assertIn(self._page_title, self.page_title,
"Expected to find %s in page title, instead found: %s"
% (self._page_title, self.page_title))
return True
def get_url_current_page(self):