def test_raise(): un = Uname(context_wrap(BAD_UNAME)) with pytest.raises(ParseException): redhat_release(None, un) with pytest.raises(ParseException): RedHatRelease(un, None) with pytest.raises(ParseException): RedHatRelease(None, None)
def test_raise(): un = Uname(context_wrap(BAD_UNAME)) with pytest.raises(SkipComponent): redhat_release(None, un) with pytest.raises(SkipComponent): RedHatRelease(un, None) with pytest.raises(SkipComponent): RedHatRelease(None, None)
def test_doc_examples(): env = { 'rh_release': redhat_release(None, Uname(context_wrap(UNAME))), 'rh_rel': RedHatRelease(Uname(context_wrap(UNAME)), None), } failed, total = doctest.testmod(rr, globs=env) assert failed == 0
def test_both(): un = Uname(context_wrap(UNAME)) rel = RedhatRelease(context_wrap(REDHAT_RELEASE)) expected = (7, 2) result = redhat_release(rel, un) assert result.major == expected[0] assert result.minor == expected[1]
def test_redhat_release(): rel = RedhatRelease(context_wrap(REDHAT_RELEASE)) expected = (7, 2) result = redhat_release(rel, None) assert result.major == expected[0] assert result.minor == expected[1]
def test_uname(): un = Uname(context_wrap(UNAME)) expected = (7, 2) result = redhat_release(None, un) assert result.major == expected[0] assert result.minor == expected[1]
def test_raise(): un = Uname(context_wrap(BAD_UNAME)) with pytest.raises(Exception): redhat_release(None, un)