Exemplo n.º 1
0
    def _assert_check_scaling(self,
                              get_plugin_p=None,
                              get_cluster_p=None,
                              data=None, cluster=None,
                              expected_message=None):

        get_cluster_p.return_value = cluster
        get_plugin_p.side_effect = _get_plugin

        with testtools.ExpectedException(ex.InvalidException):
            try:
                c_s.check_cluster_scaling(data, cluster.id)
            except ex.InvalidException as e:
                self.assertEqual(expected_message, six.text_type(e))
                raise e
    def _assert_check_scaling(self,
                              get_plugin_p=None,
                              get_cluster_p=None,
                              data=None, cluster=None,
                              expected_message=None):

        get_cluster_p.return_value = cluster
        get_plugin_p.side_effect = _get_plugin

        with self.assertRaises(ex.InvalidException):
            try:
                c_s.check_cluster_scaling(data, cluster.id)
            except ex.InvalidException as e:
                self.assertEqual(expected_message, six.text_type(e))
                raise e
    def _assert_check_scaling(self,
                              get_plugin_p=None,
                              get_cluster_p=None,
                              data=None, cluster=None,
                              expected_message=None):

        get_cluster_p.return_value = cluster
        get_plugin_p.side_effect = _get_plugin

        with testtools.ExpectedException(ex.InvalidException):
            try:
                c_s.check_cluster_scaling(data, cluster.id)
            except ex.InvalidException as e:
                message = six.text_type(e).split('\n')[0]
                self.assertEqual(expected_message, message)
                raise e