You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2017/09/14 12:22:12 UTC

[cloudstack] branch master updated: CLOUDSTACK-10068: Fixing test_iso.py assertions are equating srt and bool instead of the same types (#2261)

This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new d84585f  CLOUDSTACK-10068: Fixing test_iso.py assertions are equating srt and bool instead of the same types (#2261)
d84585f is described below

commit d84585fa6ea23a33392a85b3fa7532308c722d1e
Author: Boris Stoyanov - a.k.a Bobby <bs...@gmail.com>
AuthorDate: Thu Sep 14 15:22:09 2017 +0300

    CLOUDSTACK-10068: Fixing test_iso.py assertions are equating srt and bool instead of the same types (#2261)
    
    It appears that asserts.equal(boolean.True, str.True) which seems to be causing the issue. Probably related to some api changes in recent PRs. Will fix the equation to str.lower() so it'll pass.
    
    Strangely when running the tests from Pycharm CE they pass, it seems the IDE resolves the type issue during comparison. But when running from command line it failes...
    
    After fixing this results came back as expected:
---
 test/integration/smoke/test_iso.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py
index 9bad575..f55f818 100755
--- a/test/integration/smoke/test_iso.py
+++ b/test/integration/smoke/test_iso.py
@@ -320,8 +320,8 @@ class TestISO(cloudstackTestCase):
             "Check display text of updated ISO"
         )
         self.assertEqual(
-            iso_response.bootable,
-            self.services["bootable"],
+            str(iso_response.bootable).lower(),
+            str(self.services["bootable"]).lower(),
             "Check if image is bootable of updated ISO"
         )
 
@@ -473,14 +473,14 @@ class TestISO(cloudstackTestCase):
             "Check ISO ID"
         )
         self.assertEqual(
-            iso_response.ispublic,
-            self.services["ispublic"],
+            str(iso_response.ispublic).lower(),
+            str(self.services["ispublic"]).lower(),
             "Check ispublic permission of ISO"
         )
 
         self.assertEqual(
-            iso_response.isfeatured,
-            self.services["isfeatured"],
+            str(iso_response.isfeatured).lower(),
+            str(self.services["isfeatured"]).lower(),
             "Check isfeatured permission of ISO"
         )
         return

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <co...@cloudstack.apache.org>'].