[oe-commits] [bitbake] 17/40: toaster-tests: fix erroneous message when test fails

git at git.openembedded.org git at git.openembedded.org
Wed Aug 10 23:12:00 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit 34943b2278efe99c6744399e04a47cdda630468e
Author: Elliot Smith <elliot.smith at intel.com>
AuthorDate: Fri Jul 15 12:09:57 2016 +0100

    toaster-tests: fix erroneous message when test fails
    
    When one of the layer details tests fails (as it occasionally
    does, if running on a machine under heavy load, due to sync issues),
    the error message shown is misleading, as it is something like:
    
    "Expected 'This was imported' in ['This was imported', ...]"
    
    The string 'This was imported' is in the list shown in the message,
    but the message suggests it isn't.
    
    This is because the test compares the string with one list, but
    then uses a different list in the fail message if the comparison
    fails.
    
    Fix the list shown in the message about the test failing.
    
    Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
 lib/toaster/tests/browser/test_layerdetails_page.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/toaster/tests/browser/test_layerdetails_page.py b/lib/toaster/tests/browser/test_layerdetails_page.py
index 0005192..2fa9672 100644
--- a/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -113,8 +113,8 @@ class TestLayerDetailsPage(SeleniumTestCase):
         new_values = ["%s-edited" % old_val
                       for old_val in self.initial_values]
 
-        for inputs in self.find_all("dd input[type=text]") + \
-                self.find_all("dd textarea"):
+        for inputs in self.find_all('dd input[type="text"]') + \
+                self.find_all('dd textarea'):
             # ignore the tt inputs (twitter typeahead input)
             if "tt-" in inputs.get_attribute("class"):
                 continue
@@ -122,8 +122,8 @@ class TestLayerDetailsPage(SeleniumTestCase):
             value = inputs.get_attribute("value")
 
             self.assertTrue(value in new_values,
-                            "Expecting any of \"%s\"but got \"%s\"" %
-                            (self.initial_values, value))
+                            "Expecting any of \"%s\" but got \"%s\"" %
+                            (new_values, value))
 
     def test_delete_layer(self):
         """ Delete the layer """

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list