From 5a26e4e5b0f030c984db6cf653d62737dff03cb5 Mon Sep 17 00:00:00 2001 From: Dao Cong Tien Date: Thu, 26 Oct 2017 09:16:57 +0700 Subject: [PATCH] Fix incorrect use of assertFalse causing CI failed assertFalse should not be used with non-boolean args. Change-Id: I65340b8538104a84b45c0be39d0e0baa4c7c433c --- .../functional/test_group_replication.py | 4 +-- .../tests/functional/test_group_snapshots.py | 26 +++++++++---------- cinder/tests/functional/test_groups.py | 4 +-- cinder/tests/functional/test_volumes.py | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cinder/tests/functional/test_group_replication.py b/cinder/tests/functional/test_group_replication.py index 05e01d66dd2..66c3aa3640d 100644 --- a/cinder/tests/functional/test_group_replication.py +++ b/cinder/tests/functional/test_group_replication.py @@ -167,5 +167,5 @@ class GroupReplicationTest(functional_helpers._FunctionalTestBase): found_group = self._poll_group_while(created_group_id, ['deleting']) # Should be gone - self.assertFalse(found_volume) - self.assertFalse(found_group) + self.assertIsNone(found_volume) + self.assertIsNone(found_group) diff --git a/cinder/tests/functional/test_group_snapshots.py b/cinder/tests/functional/test_group_snapshots.py index dd31297f35f..1744b4e99d4 100644 --- a/cinder/tests/functional/test_group_snapshots.py +++ b/cinder/tests/functional/test_group_snapshots.py @@ -118,9 +118,9 @@ class GroupSnapshotsTest(functional_helpers._FunctionalTestBase): found_group = self._poll_group_while(created_group_id, ['deleting']) # Should be gone - self.assertFalse(found_group_snapshot) - self.assertFalse(found_volume) - self.assertFalse(found_group) + self.assertIsNone(found_group_snapshot) + self.assertIsNone(found_volume) + self.assertIsNone(found_group) def test_create_group_from_group_snapshot(self): """Creates a group from a group snapshot.""" @@ -218,10 +218,10 @@ class GroupSnapshotsTest(functional_helpers._FunctionalTestBase): found_group = self._poll_group_while(created_group_id, ['deleting']) # Should be gone - self.assertFalse(found_group_from_snap) - self.assertFalse(found_group_snapshot) - self.assertFalse(found_volume) - self.assertFalse(found_group) + self.assertIsNone(found_group_from_snap) + self.assertIsNone(found_group_snapshot) + self.assertIsNone(found_volume) + self.assertIsNone(found_group) def test_create_group_from_source_group(self): """Creates a group from a source group.""" @@ -298,9 +298,9 @@ class GroupSnapshotsTest(functional_helpers._FunctionalTestBase): found_group = self._poll_group_while(created_group_id, ['deleting']) # Should be gone - self.assertFalse(found_group_from_group) - self.assertFalse(found_volume) - self.assertFalse(found_group) + self.assertIsNone(found_group_from_group) + self.assertIsNone(found_volume) + self.assertIsNone(found_group) def test_reset_group_snapshot(self): # Create group @@ -352,6 +352,6 @@ class GroupSnapshotsTest(functional_helpers._FunctionalTestBase): found_group = self._poll_group_while(group_id, ['deleting']) # Created resources should be gone - self.assertFalse(found_group_snapshot) - self.assertFalse(found_volume) - self.assertFalse(found_group) + self.assertIsNone(found_group_snapshot) + self.assertIsNone(found_volume) + self.assertIsNone(found_group) diff --git a/cinder/tests/functional/test_groups.py b/cinder/tests/functional/test_groups.py index b5650f1a481..13f22b1795a 100644 --- a/cinder/tests/functional/test_groups.py +++ b/cinder/tests/functional/test_groups.py @@ -109,5 +109,5 @@ class GroupsTest(functional_helpers._FunctionalTestBase): found_group = self._poll_group_while(created_group_id, ['deleting']) # Should be gone - self.assertFalse(found_volume) - self.assertFalse(found_group) + self.assertIsNone(found_volume) + self.assertIsNone(found_group) diff --git a/cinder/tests/functional/test_volumes.py b/cinder/tests/functional/test_volumes.py index 4289ea2783e..e0a82b54189 100644 --- a/cinder/tests/functional/test_volumes.py +++ b/cinder/tests/functional/test_volumes.py @@ -75,7 +75,7 @@ class VolumesTest(functional_helpers._FunctionalTestBase): found_volume = self._poll_volume_while(created_volume_id, ['deleting']) # Should be gone - self.assertFalse(found_volume) + self.assertIsNone(found_volume) def test_create_volume_with_metadata(self): """Creates a volume with metadata."""