def test_check_for_old_profiles_2(self, test_fix, inventory): """ pillar and bypass """ test_fix = test_fix() inventory() dg.__pillar__ = dict(ceph=dict(storage='foo')) outp = dg.Output(filter_args=test_fix.filter_args, bypass_pillar=True) ret = outp._check_for_old_profiles() assert ret == ''
def test_check_for_old_profiles_1(self, test_fix, inventory): """ pillar no bypass""" test_fix = test_fix() inventory() dg.__pillar__ = dict(ceph=dict(storage='foo')) ret = dg.Output( filter_args=test_fix.filter_args)._check_for_old_profiles() assert "You seem to have " in ret
def test_check_for_old_profiles(self, test_fix, inventory): """ No pillar no bypass""" test_fix = test_fix() inventory() dg.__pillar__ = dict() ret = dg.Output( filter_args=test_fix.filter_args)._check_for_old_profiles() assert ret == ""
def test_deploy_3(self, log, error_message, c_v_command, test_fix, inventory): """ c_v_commands contains list of non-ceph-volume commands""" test_fix = test_fix() inventory() ret = dg.Output(filter_args=test_fix.filter_args).deploy() log.error.assert_called_with(c_v_command.return_value[0]) assert ret == []
def test_deploy_4(self, log, error_message, c_v_command, test_fix, inventory): """ c_v_commands contains list of mixed-ceph-volume commands""" test_fix = test_fix() inventory() dg.__salt__ = dict() dg.__salt__['helper.run'] = Mock() ret = dg.Output(filter_args=test_fix.filter_args).deploy() log.error.assert_called_with(c_v_command.return_value[0]) dg.__salt__['helper.run'].assert_called_with('ceph-volume lvm foo')
def test_deploy_2(self, error_message, c_v_command, test_fix, inventory): """ c_v_commands contain a error dict """ test_fix = test_fix() inventory() ret = dg.Output(filter_args=test_fix.filter_args).deploy() assert ret == c_v_command.return_value
def test_deploy_1(self, error_message, c_v_command, test_fix, inventory): """ old_profiles detected, expect to return error_message""" test_fix = test_fix() inventory() ret = dg.Output(filter_args=test_fix.filter_args).deploy() assert ret == error_message.return_value