From 48b72c2f5147f6306ee25312a69900f38a15ccb7 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 8 Oct 2024 13:36:27 +0100 Subject: [PATCH] bitbake: toaster/tests: Improve a test to give better debug output "False is not True" is not a helpful error messgae. "XXX not in YYY" is much more helpful. Tweak the test to give more meaninful failure messages using assertIn rather than assertTrue. (Bitbake rev: 6292b5a81ce1f3cf35980d0f669a1b52f3c56695) Signed-off-by: Richard Purdie --- bitbake/lib/toaster/tests/functional/test_project_page.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/tests/functional/test_project_page.py b/bitbake/lib/toaster/tests/functional/test_project_page.py index 0e36b44ffd..deb26812ea 100644 --- a/bitbake/lib/toaster/tests/functional/test_project_page.py +++ b/bitbake/lib/toaster/tests/functional/test_project_page.py @@ -719,16 +719,16 @@ class TestProjectPage(SeleniumFunctionalTestCase): remove_layer_btn.click() self.wait_until_visible('#change-notification', poll=2) change_notification = self.find('#change-notification') - self.assertTrue( - f'You have removed 1 layer from your project' in str(change_notification.text) + self.assertIn( + f'You have removed 1 layer from your project', str(change_notification.text) ) # check add layer button works, 18 is the random layer id add_layer_btn = self.find('#add-remove-layer-btn') add_layer_btn.click() self.wait_until_visible('#change-notification') change_notification = self.find('#change-notification') - self.assertTrue( - f'You have added 1 layer to your project' in str(change_notification.text) + self.assertIn( + f'You have added 1 layer to your project', str(change_notification.text) ) # check tabs(layers, recipes, machines) are displayed tabs = self.find_all('.nav-tabs li')