Replace 'raise AssertionError' with 'self.assertIn'

Change-Id: I07a58b50ca5a9651103d2d16be6cf8bcc64beb3a
Closes-Bug: #1403268
This commit is contained in:
Masaki Matsushita 2015-03-19 15:38:30 +09:00
parent b69b66e7fa
commit e6f20dc036
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):