bitbake: toaster: Fix assertRegexpMatches deprecation warnings

Fix:
    DeprecationWarning: Please use assertRegex instead.

(Bitbake rev: 81ee203fd55d45b199d7c3af681855d254e0d876)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2023-12-06 14:43:09 +00:00
parent 029e82d418
commit c2484f3dec
2 changed files with 6 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ class TestMostRecentBuildsStates(SeleniumTestCase):
# build queued; check shown as queued
selector = base_selector + '[data-build-state="Queued"]'
element = self.wait_until_visible(selector)
self.assertRegexpMatches(element.get_attribute('innerHTML'),
self.assertRegex(element.get_attribute('innerHTML'),
'Build queued', 'build should show queued status')
# waiting for recipes to be parsed
@@ -97,7 +97,7 @@ class TestMostRecentBuildsStates(SeleniumTestCase):
selector = base_selector + '[data-build-state="Starting"]'
element = self.wait_until_visible(selector)
self.assertRegexpMatches(element.get_attribute('innerHTML'),
self.assertRegex(element.get_attribute('innerHTML'),
'Tasks starting', 'build should show "tasks starting" status')
# first task finished; check tasks progress bar
@@ -186,7 +186,7 @@ class TestMostRecentBuildsStates(SeleniumTestCase):
selector = '[data-latest-build-result="%s"] ' \
'[data-build-state="Cancelling"]' % build.id
element = self.wait_until_visible(selector)
self.assertRegexpMatches(element.get_attribute('innerHTML'),
self.assertRegex(element.get_attribute('innerHTML'),
'Cancelling the build', 'build should show "cancelling" status')
# check cancelled state
@@ -198,5 +198,5 @@ class TestMostRecentBuildsStates(SeleniumTestCase):
selector = '[data-latest-build-result="%s"] ' \
'[data-build-state="Cancelled"]' % build.id
element = self.wait_until_visible(selector)
self.assertRegexpMatches(element.get_attribute('innerHTML'),
self.assertRegex(element.get_attribute('innerHTML'),
'Build cancelled', 'build should show "cancelled" status')

View File

@@ -136,7 +136,7 @@ class TestNewCustomImagePage(SeleniumTestCase):
"""
self._create_custom_image(self.recipe.name)
element = self.wait_until_visible('#invalid-name-help')
self.assertRegexpMatches(element.text.strip(),
self.assertRegex(element.text.strip(),
'image with this name already exists')
def test_new_duplicates_project_image(self):
@@ -154,4 +154,4 @@ class TestNewCustomImagePage(SeleniumTestCase):
self._create_custom_image(custom_image_name)
element = self.wait_until_visible('#invalid-name-help')
expected = 'An image with this name already exists in this project'
self.assertRegexpMatches(element.text.strip(), expected)
self.assertRegex(element.text.strip(), expected)