@pytest.mark.parametrize('in_,pos,expected', [
    ('TEST', 0, 'T'),

    ('\033[31mTEST', 0, '\033[31mT'),
    ('\033[31mTEST', 3, '\033[31mT'),

    ('\033[31mT\033[32mE\033[33mS\033[34mT', 0, '\033[31mT\033[32m\033[33m\033[34m'),
    ('\033[31mT\033[32mE\033[33mS\033[34mT', 2, '\033[31m\033[32m\033[33mS\033[34m'),

    ('\033[31mTEST\033[0m', 1, '\033[31mE\033[0m'),
    ('\033[31mTEST\033[0m', 3, '\033[31mT\033[0m'),

    ('T\033[31mES\033[0mT', 0, 'T\033[31m\033[0m'),
    ('T\033[31mES\033[0mT', 1, '\033[31mE\033[0m'),
    ('T\033[31mES\033[0mT', 2, '\033[31mS\033[0m'),
    ('T\033[31mES\033[0mT', 3, '\033[31m\033[0mT'),
])
def test_find_char_color(in_, pos, expected):
    index = build_color_index(in_)
    color_pos = index[pos]
    actual = find_char_color(in_, color_pos)
    assert actual == expected
Pull messages from a given subscription.
dataset/ETHPy150Open Robpol86/colorclass/tests/test_search.py/test_find_char_color--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/cloud-pubsub-samples-python/cmdline-pull/pubsub_sample.py/pull_messages