Exemplo n.º 1
0
def test_wrong_function_indentation(
    assert_errors,
    parse_ast_tree,
    code,
    default_options,
):
    """Testing that poorly indented functions do not work."""
    tree = parse_ast_tree(code)

    visitor = WrongParametersIndentationVisitor(default_options, tree=tree)
    visitor.run()

    assert_errors(visitor, [ParametersIndentationViolation])
Exemplo n.º 2
0
def test_correct_function_indentation(
    assert_errors,
    parse_ast_tree,
    code,
    default_options,
):
    """Testing that correctly indented functions work."""
    tree = parse_ast_tree(code)

    visitor = WrongParametersIndentationVisitor(default_options, tree=tree)
    visitor.run()

    assert_errors(visitor, [])