예제 #1
0
def test_nonmonotonic_warning(caplog):
    pages = _pages_from_ranges('1, 3, 2')
    assert pages == {0, 1, 2}
    assert 'out of order' in caplog.text
예제 #2
0
def test_list_range():
    assert _pages_from_ranges([0, 1, 2]) == {0, 1, 2}
예제 #3
0
def test_pages(pages, result):
    if isinstance(result, type):
        with pytest.raises(result):
            _pages_from_ranges(pages)
    else:
        assert _pages_from_ranges(pages) == result