示例#1
0
def test_parenthesis_generator_with_text():
    assert parenthesis_generator([
        '/say Test number ((-3:3:1.5)). value: ((0))!'
    ]) == [
        '/say Test number -3. value: -3!',
        '/say Test number -1.5. value: -1.5!', '/say Test number 0. value: 0!',
        '/say Test number 1.5. value: 1.5!'
    ]
def test_parenthesis_generator_with_text():
    assert parenthesis_generator(['/say Test number ((-3:3:1.5)). value: ((0))!']) == [
        '/say Test number -3. value: -3!',
        '/say Test number -1.5. value: -1.5!',
        '/say Test number 0. value: 0!',
        '/say Test number 1.5. value: 1.5!']
def test_parenthesis_generator_with_multiple_indices():
    assert parenthesis_generator(['((-3:3:1.5)) ((6:8)) ((0)) ((1))']) == ['-3 6 -3 6', '-3 7 -3 7', '-1.5 6 -1.5 6',
                                                                           '-1.5 7 -1.5 7', '0 6 0 6',
                                                                           '0 7 0 7', '1.5 6 1.5 6',
                                                                           '1.5 7 1.5 7']
def test_parenthesis_generator_with_index():
    assert parenthesis_generator(['((-3:3:1.5)) ((0))']) == ['-3 -3', '-1.5 -1.5', '0 0', '1.5 1.5']
def test_parenthesis_generator_with_step():
    assert parenthesis_generator(['((-3:3:1.5))']) == ['-3', '-1.5', '0', '1.5']
def test_parenthesis_generator_with_maxi():
    assert parenthesis_generator(['((-3:3))']) == ['-3', '-2', '-1', '0', '1', '2']
示例#7
0
def test_parenthesis_generator_with_multiple_indices():
    assert parenthesis_generator(['((-3:3:1.5)) ((6:8)) ((0)) ((1))']) == [
        '-3 6 -3 6', '-3 7 -3 7', '-1.5 6 -1.5 6', '-1.5 7 -1.5 7', '0 6 0 6',
        '0 7 0 7', '1.5 6 1.5 6', '1.5 7 1.5 7'
    ]
示例#8
0
def test_parenthesis_generator_with_index():
    assert parenthesis_generator(
        ['((-3:3:1.5)) ((0))']) == ['-3 -3', '-1.5 -1.5', '0 0', '1.5 1.5']
示例#9
0
def test_parenthesis_generator_with_step():
    assert parenthesis_generator(['((-3:3:1.5))'
                                  ]) == ['-3', '-1.5', '0', '1.5']
示例#10
0
def test_parenthesis_generator_with_maxi():
    assert parenthesis_generator(['((-3:3))'
                                  ]) == ['-3', '-2', '-1', '0', '1', '2']