コード例 #1
0
 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())
コード例 #2
0
ファイル: test_editor.py プロジェクト: liyongming1982/retext
	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())
コード例 #3
0
 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())
コード例 #4
0
ファイル: test_editor.py プロジェクト: liyongming1982/retext
	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())