CS4820-Winter2020 student project to create a COUNTER SUSHI R5 harvester and related functionality app for Windows and Mac
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
3.1 KiB

import unittest
import sys
from PyQt5.QtWidgets import QApplication, QWidget
from ui import SettingsTab
app = QApplication(sys.argv)
settingsTab_widget = QWidget()
settingsTab_widget_ui = SettingsTab.Ui_settings_tab()
settingsTab_widget_ui.setupUi(settingsTab_widget)
class SettingsTabTests(unittest.TestCase):
def test_defaults(self):
'''Test the defaults'''
self.assertEqual(settingsTab_widget_ui.label_25.text(), "Yearly Reports Directory")
self.assertEqual(settingsTab_widget_ui.label_29.text(),"Other Reports Directory")
self.assertEqual(settingsTab_widget_ui.label_30.text(), "Report Request Interval")
self.assertEqual(settingsTab_widget_ui.label_31.text(), "Concurrent Vendors")
self.assertEqual(settingsTab_widget_ui.label_32.text(), "Concurrent Reports")
self.assertEqual(settingsTab_widget_ui.label_33.text(), "Empty Cell")
self.assertEqual(settingsTab_widget_ui.label_37.text(), "Request Timeout")
self.assertEqual(settingsTab_widget_ui.label_73.text(), "User Agent")
self.assertEqual(settingsTab_widget_ui.label_24.text(),"Reports")
self.assertEqual(settingsTab_widget_ui.label_26.text(),"Search")
def test_pushButton(self):
'''Test the defaults'''
self.assertEqual(settingsTab_widget_ui.save_button.text(),"Save Changes")
self.assertEqual(settingsTab_widget_ui.concurrent_reports_help_button.text(),"?")
self.assertEqual(settingsTab_widget_ui.concurrent_vendors_help_button.text(), "?")
self.assertEqual(settingsTab_widget_ui.empty_cell_help_button.text(), "?")
self.assertEqual(settingsTab_widget_ui.other_directory_help_button.text(), "?")
self.assertEqual(settingsTab_widget_ui.request_interval_help_button.text(), "?")
self.assertEqual(settingsTab_widget_ui.request_timeout_help_button.text(), "?")
self.assertEqual(settingsTab_widget_ui.other_directory_button.text(),"Choose")
self.assertEqual(settingsTab_widget_ui.yearly_directory_button.text(), "Choose")
self.assertEqual(settingsTab_widget_ui.user_agent_help_button.text(), "?")
self.assertEqual(settingsTab_widget_ui.yearly_directory_help_button.text(), "?")
self.assertEqual(settingsTab_widget_ui.settings_restore_database_button.text(),"Restore Database")
def test_spinBox(self):
'''Test the defaults'''
self.assertEqual(settingsTab_widget_ui.concurrent_reports_spin_box.value(),0)
self.assertEqual(settingsTab_widget_ui.concurrent_vendors_spin_box.value(), 0)
self.assertEqual(settingsTab_widget_ui.request_interval_spin_box.value(), 0)
self.assertEqual(settingsTab_widget_ui.request_timeout_spin_box.value(), 0)
def test_lineEdit(self):
'''Test the defaults'''
self.assertEqual(settingsTab_widget_ui.empty_cell_edit.text(),"")
self.assertEqual(settingsTab_widget_ui.other_directory_edit.text(),"")
self.assertEqual(settingsTab_widget_ui.user_agent_edit.text(),"")
self.assertEqual(settingsTab_widget_ui.yearly_directory_edit.text(),"")
if __name__ == '__main__':
unittest.main()