← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1403268] Re: Replace 'raise AssertionError' in integration tests with 'self.assertIn'

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1403268

Title:
  Replace 'raise AssertionError' in integration tests with
  'self.assertIn'

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  The integration test has a function called 'is_the_page_title' which checks the title of current page with title assigned for each page on horizon like Login page has its own title etc.
  The comparison and raising of AssertionError when title doesnt meet actual page title , can be easily replaced with unittest built-in function 'assertIn( str1, str2, msg ) as follows:
   ORIGINAL:
      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))

  PROPOSED :
      def is_the_current_page(self):
         self.assertIn(title, self.page_title,
              "Expected to find %s in page title, instead found: %s"
                  % (self._page_title, self.page_title))

  The source code for the specific function is here :
  https://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/test/integration_tests/pages/pageobject.py

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1403268/+subscriptions


References