def test_running_submgr_fail(monkeypatch):
    monkeypatch.setattr(library, 'get_repos_to_enable', lambda: {'some-repo'})
    monkeypatch.setattr(library, 'run', run_mocked(raise_err=True))
    monkeypatch.setattr(api, 'current_logger', logger_mocked())
    library.enable_rhsm_repos()
    assert library.run.called
    assert api.current_logger.warnmsg
def test_enable_repos_skip_rhsm(monkeypatch):
    monkeypatch.setenv('LEAPP_DEVEL_SKIP_RHSM', '1')
    monkeypatch.setattr(library, 'run', run_mocked())
    monkeypatch.setattr(api, 'current_logger', logger_mocked())
    library.enable_rhsm_repos()
    assert not library.run.called
    assert api.current_logger.dbgmsg
예제 #3
0
 def process(self):
     library.set_rhsm_release()
     library.enable_rhsm_repos()
def test_running_submgr_ok(monkeypatch):
    monkeypatch.setattr(library, 'get_repos_to_enable', lambda: {'some-repo'})
    monkeypatch.setattr(library, 'run', run_mocked())
    library.enable_rhsm_repos()
    assert library.run.called
    assert 'subscription-manager' in library.run.args[0][0]