def test_indentLessWithSelection(self): self.document.setPlainText(' foo\n bar\nbaz') cursor = QTextCursor(self.document) cursor.setPosition(5) cursor.setPosition(11, QTextCursor.KeepAnchor) documentIndentLess(self.document, cursor, self.settings) self.assertEqual('foo\nbar\nbaz', self.document.toPlainText())
def test_indentLess(self): self.document.setPlainText(' foo') cursor = QTextCursor(self.document) cursor.setPosition(10) documentIndentLess(self.document, cursor, self.settings) self.assertEqual(' foo', self.document.toPlainText()) documentIndentLess(self.document, cursor, self.settings) self.assertEqual('foo', self.document.toPlainText())