def test_get_chapter_nextprev_unknown_chapter(): nextprev = get_chapter_nextprev(get_config('2019'), 'random') prev_slug = nextprev[0] next_slug = nextprev[1] assert prev_slug is None and next_slug is None
def test_get_chapter_nextprev_mid_chapter(): nextprev = get_chapter_nextprev(get_config('2019'), 'css') prev_slug = nextprev[0]['slug'] next_slug = nextprev[1]['slug'] assert next_slug == 'markup' and prev_slug == 'javascript'
def test_get_chapter_nextprev_last_chapter(): nextprev = get_chapter_nextprev(get_config('2019'), 'http') prev_slug = nextprev[0]['slug'] next_slug = nextprev[1] assert next_slug is None and prev_slug == 'resource-hints'
def test_get_chapter_nextprev_1st_chapter(): nextprev = get_chapter_nextprev(get_config('2019'), 'javascript') prev_slug = nextprev[0] next_slug = nextprev[1]['slug'] assert next_slug == 'css' and prev_slug is None