Example #1
0
 def test_recommend_configs(self, provider):
     plug_utils = pu.AbstractPluginUtils()
     fake_plugin_utils = mock.Mock()
     fake_cluster = mock.Mock()
     plug_utils.recommend_configs(fake_cluster, fake_plugin_utils, False)
     self.assertEqual([
         mock.call(CONFIGURATION_SCHEMA, fake_plugin_utils, fake_cluster,
                   False)
     ], provider.call_args_list)
Example #2
0
 def __init__(self):
     self.pu = plugin_utils.AbstractPluginUtils()
     self.validator = validation.Validator
     self.c_helper = None
Example #3
0
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from sahara.plugins.cdh import plugin_utils as pu
from sahara.tests.unit import base
from sahara.tests.unit.plugins.cdh import utils as tu

PU = pu.AbstractPluginUtils()


class UtilsTestCase(base.SaharaTestCase):
    def test_get_manager(self):
        cluster = tu.get_fake_cluster()
        inst = PU.get_manager(cluster)
        self.assertEqual('id1', inst.instance_id)

    def test_get_namenode(self):
        cluster = tu.get_fake_cluster()
        inst = PU.get_namenode(cluster)
        self.assertEqual('id2', inst.instance_id)

    def test_get_secondarynamenode(self):
        cluster = tu.get_fake_cluster()
Example #4
0
 def __init__(self):
     self.pu = plugin_utils.AbstractPluginUtils()