<commit_before>import unittest
from PyQt5 import QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QLineEdit
from PyQt5.QtTest import QTest

import time
from journalist_gui.SecureDropUpdater import UpdaterApp

class AppTestCase(unittest.TestCase):
    def setUp(self):
        qApp = QApplication.instance()
        if qApp is None:
            self.app = QApplication([''])
        else:
            self.app = qApp

class WindowTestCase(AppTestCase):
    def setUp(self):
        super(WindowTestCase, self).setUp()
        self.window = UpdaterApp()
        self.window.show()
        QTest.qWaitForWindowExposed(self.window)

    def test_clicking_install_later_exits_the_application(self):
        QTest.mouseClick(self.window.pushButton, Qt.LeftButton)
        self.assertFalse(self.window.isVisible())

    def test_progress_bar_begins_at_zero(self):
        self.assertEqual(self.window.progressBar.value(), 0)


    def test_output_text_box_is_disabled(self):
        self.assertFalse(self.window.plainTextEdit.isEnabled())
        self.assertFalse(self.window.checkBox.isChecked())


    def test_output_text_box_displayed_when_checkbox_toggled(self):
        
        QTest.mouseClick(self.window.checkBox, Qt.LeftButton)
        self.assertTrue(self.window.plainTextEdit.isEnabled())

        # And clicking again should hide the text box once again
        QTest.mouseClick(self.window.checkBox, Qt.LeftButton)
        self.assertFalse(self.window.plainTextEdit.isEnabled())

if __name__ == '__main__':
    unittest.main()<commit_msg>Fixes the mouseclick in test<commit_after>import unittest
from PyQt5 import QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QLineEdit
from PyQt5.QtTest import QTest

import time
from journalist_gui.SecureDropUpdater import UpdaterApp

class AppTestCase(unittest.TestCase):
    def setUp(self):
        qApp = QApplication.instance()
        if qApp is None:
            self.app = QApplication([''])
        else:
            self.app = qApp

class WindowTestCase(AppTestCase):
    def setUp(self):
        super(WindowTestCase, self).setUp()
        self.window = UpdaterApp()
        self.window.show()
        QTest.qWaitForWindowExposed(self.window)

    def test_clicking_install_later_exits_the_application(self):
        QTest.mouseClick(self.window.pushButton, Qt.LeftButton)
        self.assertFalse(self.window.isVisible())

    def test_progress_bar_begins_at_zero(self):
        self.assertEqual(self.window.progressBar.value(), 0)


    def test_output_text_box_is_disabled(self):
        self.assertFalse(self.window.plainTextEdit.isEnabled())
        self.assertFalse(self.window.checkBox.isChecked())


    def test_output_text_box_displayed_when_checkbox_toggled(self):
        
        QTest.mouseClick(self.window.checkBox, Qt.LeftButton,
                         pos=QtCore.QPoint(2,self.window.checkBox.height()/2))
        self.assertTrue(self.window.plainTextEdit.isEnabled())

        # And clicking again should hide the text box once again
        QTest.mouseClick(self.window.checkBox, Qt.LeftButton,
                         pos=QtCore.QPoint(2,self.window.checkBox.height()/2))
        self.assertFalse(self.window.plainTextEdit.isEnabled())

if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.09441290708096803, 'fraction_numerical': 0.004182850313713774, 'mean_word_length': 3.376470588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6407226', 'n_tokens_mistral': 1029, 'n_tokens_neox': 1014, 'n_words': 177}