<s> from pyqode . qt . QtTest import QTest <EOL> from pyqode . core import api <EOL> from pyqode . core import modes <EOL> from pyqode . core . api import TextHelper <EOL> def test_enabled ( editor ) : <EOL> mode = editor . modes . get ( modes . IndenterMode ) <EOL> assert mode . enabled <EOL> mode . enabled = False <EOL> mode . enabled = True <EOL> def test_indent_selection ( editor ) : <EOL> mode = editor . modes . get ( modes . IndenterMode ) <EOL> TextHelper ( editor ) . select_lines ( ) <EOL> mode . indent ( ) <EOL> mode . unindent ( ) <EOL> TextHelper ( editor ) . select_lines ( <NUM_LIT:0> ) <EOL> mode . indent ( ) <EOL> mode . unindent ( ) <EOL> editor . use_spaces_instead_of_tabs = False <EOL> TextHelper ( editor ) . select_lines ( ) <EOL> mode . indent ( ) <EOL> mode . unindent ( ) <EOL> def test_bug_unindent ( editor ) : <EOL> mode = editor . modes . get ( modes . IndenterMode ) <EOL> editor . use_spaces_instead_of_tabs = True <EOL> editor . setPlainText ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:utf-8>' ) <EOL> api . TextHelper ( editor ) . goto_line ( <NUM_LIT:0> , column = len ( '<STR_LIT>' ) ) <EOL> mode . unindent ( ) <EOL> assert editor . toPlainText ( ) == '<STR_LIT>' </s>
