示例#1
0
def test_meta_mode(meta, last_action, expected):
    atom = '{MODE:' + meta + '}'
    ctx = formatting._Context((), action())
    ctx.translated(last_action)
    if inspect.isclass(expected):
        with pytest.raises(expected):
            formatting._atom_to_action(atom, ctx)
    else:
        assert formatting._atom_to_action(atom, ctx) == expected
示例#2
0
def test_meta_carry_capitalize(meta, last_action, expected):
    ctx = formatting._Context((), action())
    ctx.translated(last_action)
    assert formatting._atom_to_action('{' + meta + '}', ctx) == expected
示例#3
0
def test_meta_mode(meta, last_action, expected):
    ctx = formatting._Context((), action())
    ctx.translated(last_action)
    assert formatting._atom_to_action('{MODE:' + meta + '}', ctx) == expected
示例#4
0
def test_atom_to_action(atom, last_action, expected):
    ctx = formatting._Context((), last_action)
    ctx.translated(last_action)
    assert formatting._atom_to_action(atom, ctx) == expected
示例#5
0
def test_meta_carry_capitalize(meta, last_action, expected):
    ctx = formatting._Context((), action())
    ctx.translated(last_action)
    assert formatting._atom_to_action('{' + meta + '}', ctx) == expected
示例#6
0
def test_meta_mode(meta, last_action, expected):
    ctx = formatting._Context((), action())
    ctx.translated(last_action)
    assert formatting._atom_to_action('{MODE:' + meta + '}', ctx) == expected
示例#7
0
def test_atom_to_action(atom, last_action, expected):
    ctx = formatting._Context((), last_action)
    ctx.translated(last_action)
    assert formatting._atom_to_action(atom, ctx) == expected
示例#8
0
def test_atom_to_action(atom, last_action, spaces_after, expected):
    assert formatting._atom_to_action(atom, last_action,
                                      spaces_after) == expected