Example #1
0
def test_all_extended_patterns():
    given = ('This is an **example** [Markdown](https://commonmark.org/)\n'
             'comment. Here are some requests:\n'
             '{{anime 1}} {{anime2}}\n'
             '<<manga 1>> <<manga2>>\n'
             ']]light novel 1[[ ]]light_novel2[[\n'
             '||visual novel 1|| ||visual_novel2||\n')
    expected = [
        'anime 1',
        'anime2',
        'manga 1',
        'manga2',
        'light novel 1',
        'light_novel2',
        'visual novel 1',
        'visual_novel2',
    ]
    actual = list(find_requests('all', given, expanded=True))
    assert actual == expected
Example #2
0
def test_all_regular_patterns():
    given = ('This is an **example** [Markdown](https://commonmark.org/)\n'
             'comment. Here are some requests:\n'
             '{anime 1} {anime2}\n'
             '<manga 1> <manga2>\n'
             ']light novel 1[ ]light_novel2[\n'
             '|visual novel 1| |visual_novel2|\n')
    expected = [
        'anime 1',
        'anime2',
        'manga 1',
        'manga2',
        'light novel 1',
        'light_novel2',
        'visual novel 1',
        'visual_novel2',
    ]
    actual = list(find_requests('all', given))
    assert actual == expected
Example #3
0
def test_expanded_anime(given, expected):
    actual = list(find_requests('anime', given, expanded=True))
    assert actual == expected
Example #4
0
def test_regular_anime(given, expected):
    actual = list(find_requests('anime', given))
    assert actual == expected
Example #5
0
def test_expanded_visual_novel(given, expected):
    actual = list(find_requests('visual_novel', given, expanded=True))
    assert actual == expected
Example #6
0
def test_regular_visual_novel(given, expected):
    actual = list(find_requests('visual_novel', given))
    assert actual == expected
Example #7
0
def test_expanded_manga(given, expected):
    actual = list(find_requests('manga', given, expanded=True))
    assert actual == expected
Example #8
0
def test_regular_manga(given, expected):
    actual = list(find_requests('manga', given))
    assert actual == expected