SILENT KILLERPanel

Current Path: > > opt > alt > python35 > lib64 > > python3.5 > idlelib > idle_test


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/alt/python35/lib64//python3.5/idlelib/idle_test

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
README.txt File 5619 bytes November 01 2019 23:02:34.
__init__.py File 650 bytes May 31 2024 13:51:41.
htest.py File 13802 bytes May 31 2024 13:51:41.
mock_idle.py File 1573 bytes May 31 2024 13:51:41.
mock_tk.py File 11626 bytes May 31 2024 13:51:41.
test_autocomplete.py File 4917 bytes May 31 2024 13:51:41.
test_autoexpand.py File 4118 bytes May 31 2024 13:51:41.
test_calltips.py File 6643 bytes May 31 2024 13:51:41.
test_config_help.py File 3566 bytes May 31 2024 13:51:41.
test_config_name.py File 2399 bytes May 31 2024 13:51:41.
test_configdialog.py File 834 bytes May 31 2024 13:51:41.
test_delegator.py File 1531 bytes May 31 2024 13:51:41.
test_editmenu.py File 2463 bytes May 31 2024 13:51:41.
test_editor.py File 586 bytes May 31 2024 13:51:41.
test_formatparagraph.py File 14331 bytes May 31 2024 13:51:41.
test_grep.py File 2671 bytes May 31 2024 13:51:41.
test_help_about.py File 1571 bytes May 31 2024 13:51:41.
test_hyperparser.py File 9089 bytes May 31 2024 13:51:41.
test_idlehistory.py File 5493 bytes May 31 2024 13:51:41.
test_io.py File 8366 bytes May 31 2024 13:51:41.
test_parenmatch.py File 3564 bytes May 31 2024 13:51:41.
test_pathbrowser.py File 882 bytes May 31 2024 13:51:41.
test_percolator.py File 4053 bytes May 31 2024 13:51:41.
test_replacedialog.py File 8304 bytes May 31 2024 13:51:41.
test_rstrip.py File 1613 bytes May 31 2024 13:51:41.
test_searchdialog.py File 2411 bytes May 31 2024 13:51:41.
test_searchdialogbase.py File 5872 bytes May 31 2024 13:51:41.
test_searchengine.py File 11518 bytes May 31 2024 13:51:41.
test_text.py File 6739 bytes May 31 2024 13:51:41.
test_textview.py File 2898 bytes May 31 2024 13:51:41.
test_undodelegator.py File 4289 bytes May 31 2024 13:51:41.
test_warning.py File 2752 bytes May 31 2024 13:51:41.
test_widgetredir.py File 4201 bytes May 31 2024 13:51:41.

Reading File: //opt/alt/python35/lib64//python3.5/idlelib/idle_test/test_searchdialog.py

"""Test SearchDialog class in SearchDialogue.py"""

# Does not currently test the event handler wrappers.
# A usage test should simulate clicks and check hilighting.
# Tests need to be coordinated with SearchDialogBase tests
# to avoid duplication.

from test.support import requires
requires('gui')

import unittest
import tkinter as tk
from tkinter import BooleanVar
import idlelib.SearchEngine as se
import idlelib.SearchDialog as sd


class SearchDialogTest(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls.root = tk.Tk()

    @classmethod
    def tearDownClass(cls):
        cls.root.destroy()
        del cls.root

    def setUp(self):
        self.engine = se.SearchEngine(self.root)
        self.dialog = sd.SearchDialog(self.root, self.engine)
        self.text = tk.Text(self.root)
        self.text.insert('1.0', 'Hello World!')

    def test_find_again(self):
        # Search for various expressions
        text = self.text

        self.engine.setpat('')
        self.assertFalse(self.dialog.find_again(text))

        self.engine.setpat('Hello')
        self.assertTrue(self.dialog.find_again(text))

        self.engine.setpat('Goodbye')
        self.assertFalse(self.dialog.find_again(text))

        self.engine.setpat('World!')
        self.assertTrue(self.dialog.find_again(text))

        self.engine.setpat('Hello World!')
        self.assertTrue(self.dialog.find_again(text))

        # Regular expression
        self.engine.revar = BooleanVar(self.root, True)
        self.engine.setpat('W[aeiouy]r')
        self.assertTrue(self.dialog.find_again(text))

    def test_find_selection(self):
        # Select some text and make sure it's found
        text = self.text
        # Add additional line to find
        self.text.insert('2.0', 'Hello World!')

        text.tag_add('sel', '1.0', '1.4')       # Select 'Hello'
        self.assertTrue(self.dialog.find_selection(text))

        text.tag_remove('sel', '1.0', 'end')
        text.tag_add('sel', '1.6', '1.11')      # Select 'World!'
        self.assertTrue(self.dialog.find_selection(text))

        text.tag_remove('sel', '1.0', 'end')
        text.tag_add('sel', '1.0', '1.11')      # Select 'Hello World!'
        self.assertTrue(self.dialog.find_selection(text))

        # Remove additional line
        text.delete('2.0', 'end')

if __name__ == '__main__':
    unittest.main(verbosity=2, exit=2)

SILENT KILLER Tool