Fix unit test failure with python3.6
Since python3.6 os.path.join can be either bytes or a str. So mock os.path.join in order for the unit tests to pass. Change-Id: I82c793875d888092e5c814727a6c4ad4053e76fb Signed-off-by: Chuck Short <chucks@redhat.com>
This commit is contained in:
parent
ee643b3ccb
commit
72f7e5f72e
|
@ -71,7 +71,8 @@ class TestHeatPoller(base.TestCase):
|
||||||
self.assertEqual(cluster_status.CREATE_FAILED, cluster.status)
|
self.assertEqual(cluster_status.CREATE_FAILED, cluster.status)
|
||||||
self.assertEqual('Create failed', cluster.status_reason)
|
self.assertEqual('Create failed', cluster.status_reason)
|
||||||
|
|
||||||
def test_poll_done(self):
|
@patch('os.path.join')
|
||||||
|
def test_poll_done(self, mock_join):
|
||||||
mock_heat_stack, cluster, poller = self.setup_poll_test()
|
mock_heat_stack, cluster, poller = self.setup_poll_test()
|
||||||
|
|
||||||
mock_heat_stack.stack_status = cluster_status.DELETE_COMPLETE
|
mock_heat_stack.stack_status = cluster_status.DELETE_COMPLETE
|
||||||
|
@ -124,7 +125,8 @@ class TestHeatPoller(base.TestCase):
|
||||||
self.assertEqual(cluster_status.ROLLBACK_FAILED, cluster.status)
|
self.assertEqual(cluster_status.ROLLBACK_FAILED, cluster.status)
|
||||||
self.assertEqual(1, cluster.node_count)
|
self.assertEqual(1, cluster.node_count)
|
||||||
|
|
||||||
def test_poll_destroy(self):
|
@patch('os.path.join')
|
||||||
|
def test_poll_destroy(self, mock_join):
|
||||||
mock_heat_stack, cluster, poller = self.setup_poll_test()
|
mock_heat_stack, cluster, poller = self.setup_poll_test()
|
||||||
|
|
||||||
mock_heat_stack.stack_status = cluster_status.DELETE_FAILED
|
mock_heat_stack.stack_status = cluster_status.DELETE_FAILED
|
||||||
|
|
Loading…
Reference in New Issue