From 380de9d1d9d43088c8101bdf1cbdde9ccc6663ca Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Wed, 4 Mar 2020 14:58:48 +0530 Subject: [PATCH] Inbox PopMenu functionality --- src/bitmessageqt/__init__.py | 30 ++-- .../test_addressgeneration.py | 50 ++++--- src/graphicaltesting/test_addsubscription.py | 29 ++-- src/graphicaltesting/test_blackwhitelist.py | 12 +- src/graphicaltesting/test_chans.py | 2 - src/graphicaltesting/test_inbox_popmenu.py | 134 ++++++++++++++++++ src/graphicaltesting/test_messagesend.py | 10 +- src/graphicaltesting/test_networkstatus.py | 13 +- src/graphicaltesting/test_settingwindow.py | 2 +- src/graphicaltesting/testinitialization.py | 21 ++- src/graphicaltesting/testloader.py | 2 +- 11 files changed, 236 insertions(+), 69 deletions(-) create mode 100644 src/graphicaltesting/test_inbox_popmenu.py diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 9c964dde..33291ece 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2514,15 +2514,19 @@ class MyForm(settingsmixin.SMainWindow): self.ui.textEditMessage.setFocus() def on_action_MarkAllRead(self): - if QtGui.QMessageBox.question( - self, "Marking all messages as read?", - _translate( - "MainWindow", - "Are you sure you would like to mark all messages read?" - ), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No - ) != QtGui.QMessageBox.Yes: - return - tableWidget = self.getCurrentMessagelist() + import state + if state.qttesting: + tableWidget = self.getCurrentMessagelist() + else: + if QtGui.QMessageBox.question( + self, "Marking all messages as read?", + _translate( + "MainWindow", + "Are you sure you would like to mark all messages read?" + ), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No + ) != QtGui.QMessageBox.Yes: + return + tableWidget = self.getCurrentMessagelist() idCount = tableWidget.rowCount() if idCount == 0: @@ -3778,8 +3782,12 @@ class MyForm(settingsmixin.SMainWindow): self.popMenuYourIdentities.addAction(self.actionMarkAllRead) if self.popMenuYourIdentities.isEmpty(): return - self.popMenuYourIdentities.exec_( - self.ui.treeWidgetYourIdentities.mapToGlobal(point)) + if state.qttesting: + self.popMenuYourIdentities.move(point.x(), point.y()) + self.popMenuYourIdentities.show() + else: + self.popMenuYourIdentities.exec_( + self.ui.treeWidgetYourIdentities.mapToGlobal(point)) # TODO make one popMenu def on_context_menuChan(self, point): diff --git a/src/graphicaltesting/test_addressgeneration.py b/src/graphicaltesting/test_addressgeneration.py index 720eafc4..849217f2 100644 --- a/src/graphicaltesting/test_addressgeneration.py +++ b/src/graphicaltesting/test_addressgeneration.py @@ -14,25 +14,29 @@ class BitmessageTest_AddressGeneration(BitmessageTestCase): def test_generateaddress(self): """Method clicks on new label pushbutton and create new address with random label""" - QTest.qWait(500) - self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.inbox) - QTest.qWait(500) try: - random_label = "" + address_count = len(BMConfigParser().addresses()) + QTest.qWait(500) + self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.inbox) + QTest.qWait(500) + self.myapp.ui.pushButtonNewAddress.setStyleSheet("QPushButton {background-color: #FF5733; color: white;}") QTest.qWait(50) self.myapp.ui.pushButtonNewAddress.setStyleSheet("") + label_gen_obj = address_dialogs.NewAddressDialog() - QTest.qWait(500) - address_count = len(BMConfigParser().addresses()) - QTest.qWait(400) + QTest.qWait(1000) + + random_label = "" for _ in range(12): - random_label = random_label + choice(ascii_lowercase) + random_label += choice(ascii_lowercase) label_gen_obj.newaddresslabel.setText(random_label) - QTest.qWait(5) - QTest.qWait(500) + QTest.qWait(2) + + QTest.qWait(600) label_gen_obj.accept() QTest.qWait(800) + self.assertEqual(len(BMConfigParser().addresses()), address_count + 1) self.assertEqual(str(BMConfigParser().get(BMConfigParser().addresses()[-1], "label")), random_label) print("\n Test Pass :--> Address Generated Successfully \n") @@ -45,36 +49,40 @@ class BitmessageTest_AddressGeneration(BitmessageTestCase): def test_generateaddresswithpassphrase(self): """Clicks on the create new label with passphrase pushbutton and generates 8 address""" - QTest.qWait(500) - self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.inbox) - QTest.qWait(500) try: - random_password1, random_password2 = "", "" + address_count = len(BMConfigParser().addresses()) + QTest.qWait(500) + self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.inbox) + QTest.qWait(500) + self.myapp.ui.pushButtonNewAddress.setStyleSheet("QPushButton {background-color: #FF5733; color: white;}") QTest.qWait(50) self.myapp.ui.pushButtonNewAddress.setStyleSheet("") + label_gen_obj = address_dialogs.NewAddressDialog() QTest.qWait(500) - address_count = len(BMConfigParser().addresses()) - QTest.qWait(400) label_gen_obj.radioButtonDeterministicAddress.click() QTest.qWait(400) + + random_password1, random_password2 = "", "" for i in range(15): random_password1 += choice(ascii_lowercase) label_gen_obj.lineEditPassphrase.setText(random_password1) - QTest.qWait(5) + QTest.qWait(2) QTest.qWait(500) + for i in random_password1: random_password2 += i label_gen_obj.lineEditPassphraseAgain.setText(random_password2) - QTest.qWait(5) - QTest.qWait(800) + QTest.qWait(2) + + QTest.qWait(850) label_gen_obj.accept() self.assertEqual(random_password1, random_password2) print(" Creating Address ......") - QTest.qWait(3000) + QTest.qWait(2500) print(" Please Wait.! Creating 8 Address ......") - QTest.qWait(3000) + QTest.qWait(2500) self.assertEqual(len(BMConfigParser().addresses()), address_count + 8) QTest.qWait(100) print("\n Test Pass :--> Address Generated Successfully with passphrase \n") diff --git a/src/graphicaltesting/test_addsubscription.py b/src/graphicaltesting/test_addsubscription.py index 0901818b..8c0723de 100644 --- a/src/graphicaltesting/test_addsubscription.py +++ b/src/graphicaltesting/test_addsubscription.py @@ -17,20 +17,23 @@ class BitmessageTest_AddSubscription(BitmessageTestCase): def test_subscription(self): """Test for subscription functionality""" - QTest.qWait(500) - self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.subscriptions) - QTest.qWait(500) - if BMConfigParser().addresses(): - try: + try: + if BMConfigParser().addresses(): + QTest.qWait(500) + self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.subscriptions) + QTest.qWait(500) + self.dialog = dialogs.NewSubscriptionDialog(self.myapp) self.dialog.show() QTest.qWait(800) + random_label = "" for _ in range(30): random_label += choice(ascii_lowercase) self.dialog.lineEditLabel.setText(random_label) QTest.qWait(5) QTest.qWait(500) + rand_address = choice(BMConfigParser().addresses()) random_address = "" for x in range(len(rand_address)): @@ -38,7 +41,9 @@ class BitmessageTest_AddSubscription(BitmessageTestCase): self.dialog.lineEditAddress.setText(random_address) QTest.qWait(5) QTest.qWait(500) + QtCore.QTimer.singleShot(0, self.dialog.buttonBox.button(QtGui.QDialogButtonBox.Ok).clicked) + try: QTest.qWait(800) address, label = self.dialog.data @@ -46,6 +51,7 @@ class BitmessageTest_AddSubscription(BitmessageTestCase): QTest.qWait(500) print("\n Test Fail :--> Error, While Creating subscription list. \n") return 0 + if shared.isAddressInMySubscriptionsList(address): print( "\n Test Fail :--> You cannot add the same address to your subscriptions twice." @@ -53,6 +59,7 @@ class BitmessageTest_AddSubscription(BitmessageTestCase): ) QTest.qWait(500) return 0 + self.myapp.addSubscription(address, label) sub_add = sqlQuery("select address from subscriptions where label='" + random_label + "'")[0] self.assertEqual(random_address, sub_add[0]) @@ -60,13 +67,13 @@ class BitmessageTest_AddSubscription(BitmessageTestCase): QTest.qWait(100) self.assertTrue(True, " \n Test Pass :--> Subscription Done Successfully!") return 1 - except: + else: QTest.qWait(100) - print("\n Test Fail :--> Error Occured while adding address to subscription list! \n") - self.assertTrue(False, " \n Test Fail :--> Error Occured while adding address to subscription list! ") + print("\n Test Fail :--> No Address Found! \n") + self.assertTrue(False, " \n Test Fail :--> No Address Found!") return 0 - else: + except: QTest.qWait(100) - print("\n Test Fail :--> No Address Found! \n") - self.assertTrue(False, " \n Test Fail :--> No Address Found!") + print("\n Test Fail :--> Error Occured while adding address to subscription list! \n") + self.assertTrue(False, " \n Test Fail :--> Error Occured while adding address to subscription list! ") return 0 diff --git a/src/graphicaltesting/test_blackwhitelist.py b/src/graphicaltesting/test_blackwhitelist.py index d08881be..697302ef 100644 --- a/src/graphicaltesting/test_blackwhitelist.py +++ b/src/graphicaltesting/test_blackwhitelist.py @@ -20,24 +20,28 @@ class BitmessageTest_BlackandWhiteList(BitmessageTestCase): def test_blackwhitelist(self): """Tab switch to blacklist and add the address on blacklist and whitelist""" - QTest.qWait(500) - self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.blackwhitelist) - QTest.qWait(500) try: + QTest.qWait(500) + self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.blackwhitelist) + QTest.qWait(500) + self.blacklist_obj = blacklist.Blacklist() self.dialog = AddAddressDialog(self.myapp) blacklistcount = len(sqlQuery("Select * from blacklist")) + self.myapp.ui.blackwhitelist.radioButtonBlacklist.click() self.checkblacklist(self.myapp) QTest.qWait(500) self.assertEqual(blacklistcount + 1, len(sqlQuery("Select * from blacklist"))) whitelistcount = len(sqlQuery("Select * from whitelist")) + self.myapp.ui.blackwhitelist.radioButtonWhitelist.click() self.checkblacklist(self.myapp) QTest.qWait(500) self.assertEqual(whitelistcount + 1, len(sqlQuery("Select * from whitelist"))) + self.assertTrue(True, " \n Test Pass :--> Black/WhiteList Functionality Tested Successfully!") except: - pass + self.assertTrue(False, " \n Test Fail :--> Black/WhiteList Functionality Failed!.") def checkblacklist(self, myapp): """fill blacklist and whitelist fields""" diff --git a/src/graphicaltesting/test_chans.py b/src/graphicaltesting/test_chans.py index 959dc530..3b037b18 100644 --- a/src/graphicaltesting/test_chans.py +++ b/src/graphicaltesting/test_chans.py @@ -11,7 +11,5 @@ class BitmessageTest_ChansTest(BitmessageTestCase): """Switch to chans window and test""" QTest.qWait(1200) self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.chans) - # QTest.mouseClick(self.myapp.ui.pushButtonAddChan, Qt.LeftButton) - # self.assertEqual('foo'.upper(), 'F00') print("\n Test Pass :--> Chans Test Passed! \n") return 1 diff --git a/src/graphicaltesting/test_inbox_popmenu.py b/src/graphicaltesting/test_inbox_popmenu.py new file mode 100644 index 00000000..039b7379 --- /dev/null +++ b/src/graphicaltesting/test_inbox_popmenu.py @@ -0,0 +1,134 @@ +"""Inbox TabWidget QTreeWidget Testing""" +import random +from random import choice +from string import ascii_lowercase + +from PyQt4 import QtCore, QtGui +from PyQt4.QtCore import Qt +from PyQt4.QtTest import QTest + +from bitmessageqt import dialogs +from bmconfigparser import BMConfigParser +from testloader import BitmessageTestCase + + +class BitmessageTest_Inbox_PopMenu(BitmessageTestCase): + """Inbox TabWidget QTreeWidget popMenu Fucntionality testing""" + + def test_sider(self): + """Show QTreeWidget popmenu""" + QTest.qWait(500) + self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.inbox) + QTest.qWait(500) + treeWidget = self.myapp.ui.treeWidgetYourIdentities + self.levelitem = treeWidget.topLevelItem(random.randint(1, len(BMConfigParser().addresses()))) + self.myapp.ui.treeWidgetYourIdentities.setCurrentItem(self.levelitem) + rect = self.myapp.ui.treeWidgetYourIdentities.visualItemRect(self.levelitem) + self.currentItem = self.myapp.getCurrentItem() + self.myapp.on_context_menuYourIdentities(QtCore.QPoint(rect.x() + 200, rect.y() + 200)) + QTest.qWait(500) + self.myapp.popMenuYourIdentities.hide() + QTest.qWait(100) + self.copy_clipboard() + QTest.qWait(100) + self.enable_disable() + QTest.qWait(100) + self.special_address_behavior() + QTest.qWait(100) + self.email_gateway() + QTest.qWait(100) + self.mark_all_as_read() + + def copy_clipboard(self): + """Copy address to clipboard and test""" + try: + text_selected = self.levelitem.text(0) + QTest.qWait(250) + self.myapp.popMenuYourIdentities.actions()[2].trigger() + QTest.qWait(750) + if str(QtGui.QApplication.clipboard().text()) in str(text_selected): + self.assertTrue(True, " Test Pass :--> Copy functionality working fine \n") + print(" Test Pass :--> Copy functionality working fine \n") + else: + print(" Test Fail :--> Copy functionality failed \n") + self.assertTrue(False, " Test Fail :--> Copy functionality failed \n") + except: + print(" Test Fail :--> Copy functionality failed \n") + self.assertTrue(False, " Test Fail :--> Copy functionality failed \n") + + def enable_disable(self): + """Enable address and disable address""" + QTest.qWait(500) + try: + if self.currentItem.isEnabled: + QTest.qWait(300) + self.myapp.popMenuYourIdentities.actions()[4].trigger() + print("Address is Disabled \n") + QTest.qWait(1000) + self.myapp.on_action_Enable() + print("Address is Enabled \n") + QTest.qWait(1000) + else: + QTest.qWait(300) + self.myapp.popMenuYourIdentities.actions()[4].trigger() + print("Address is Enabled \n") + QTest.qWait(1000) + self.myapp.on_action_Disable() + print("Address is Disabled \n") + QTest.qWait(1000) + except: + self.assertTrue(False, " Test Fail :--> Enable Disable failed \n") + + def special_address_behavior(self): + """Tests for special address""" + try: + special_add = dialogs.SpecialAddressBehaviorDialog(self.myapp, BMConfigParser()) + special_add.lineEditMailingListName.setText("") + QTest.qWait(1000) + special_add.radioButtonBehaviorMailingList.click() + QTest.qWait(500) + special_add.lineEditMailingListName.setText("".join(choice(ascii_lowercase) for x in range(15))) + QTest.qWait(1000) + QTest.mouseClick(special_add.buttonBox.button(QtGui.QDialogButtonBox.Ok), Qt.LeftButton) + self.assertTrue(True, " Test Pass :--> Special Address Behavior Functionality Passed \n") + print(" Test Pass :--> Special Address Behavior Functionality Passed \n") + except: + print(" Test Fail :--> Special Address Behavior Functionality failed \n") + self.assertTrue(False, " Test Fail :--> Special Address Behavior Functionality failed \n") + + def email_gateway(self): + """Test email gateway functionality""" + try: + QTest.qWait(200) + email_gateway = dialogs.EmailGatewayDialog(self.myapp, config=BMConfigParser()) + QTest.qWait(300) + email_gateway.show() + QTest.qWait(1000) + email_gateway.radioButtonRegister.click() + QTest.qWait(500) + email = ( + ("".join(choice(ascii_lowercase) for x in range(10))) + + "@" + + ("".join(choice(ascii_lowercase) for x in range(7))) + + ".com" + ) + email_gateway.lineEditEmail.setText(email) + QTest.qWait(1000) + QTest.mouseClick(email_gateway.buttonBox.button(QtGui.QDialogButtonBox.Ok), Qt.LeftButton) + self.assertTrue(True, " Test Pass :--> Email-Gateway Functionality Passed \n") + print(" Test Pass :--> Email-Gateway Functionality Passed \n") + except: + print(" Test Fail :--> Email-Gateway Functionality failed \n") + self.assertTrue(False, " Test Fail :--> Email-Gateway Functionality failed \n") + + def mark_all_as_read(self): + """Mark all messages as read""" + try: + QTest.qWait(1000) + self.myapp.popMenuYourIdentities.actions()[11].trigger() + QTest.qWait(200) + self.assertTrue(True, " Test Pass :--> Mark All as Read Functionality Passed \n") + print(" Test Pass :--> Mark All as Read Functionality Passed \n") + except: + print(" Test Fail :--> Mark All as Read Functionality failed \n") + self.assertTrue(False, " Test Fail :--> Mark All as Read Functionality failed \n") diff --git a/src/graphicaltesting/test_messagesend.py b/src/graphicaltesting/test_messagesend.py index b9a0b6d7..5c2ddcdb 100644 --- a/src/graphicaltesting/test_messagesend.py +++ b/src/graphicaltesting/test_messagesend.py @@ -20,11 +20,13 @@ class BitmessageTest_MessageTesting(BitmessageTestCase): if BMConfigParser().addresses(): QTest.qWait(500) self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.send) - QTest.qWait(800) + QTest.qWait(500) + self.myapp.ui.comboBoxSendFrom.setCurrentIndex( random.randrange(1, len(BMConfigParser().addresses()) + 1) ) QTest.qWait(1000) + rand_address = choice(BMConfigParser().addresses()) random_address = "" for x in range(len(rand_address)): @@ -32,27 +34,33 @@ class BitmessageTest_MessageTesting(BitmessageTestCase): self.myapp.ui.lineEditTo.setText(random_address) QTest.qWait(1) QTest.qWait(800) + random_subject = "" for x in range(40): random_subject += choice(ascii_lowercase) self.myapp.ui.lineEditSubject.setText(random_subject) QTest.qWait(1) QTest.qWait(800) + random_message = "" for x in range(200): random_message += choice(ascii_lowercase) self.myapp.ui.textEditMessage.setText(random_message) QTest.qWait(1) QTest.qWait(800) + inbox_length = len(sqlQuery("Select msgid from inbox")) QTest.mouseClick(self.myapp.ui.pushButtonSend, Qt.LeftButton) QTest.qWait(600) + self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.inbox) print(" .......................... waiting for message .......................... ") + for x in range(5): QTest.qWait(5000) print(" waiting " + x * ".") self.assertEqual(sqlQuery("Select toaddress,subject from inbox")[-1], (rand_address, random_subject)) + if len(sqlQuery("Select msgid from inbox")) == inbox_length + 1: QTest.qWait(100) print("\n Test Pass :--> Message Received Successfully \n") diff --git a/src/graphicaltesting/test_networkstatus.py b/src/graphicaltesting/test_networkstatus.py index d3dbb35a..3b252594 100644 --- a/src/graphicaltesting/test_networkstatus.py +++ b/src/graphicaltesting/test_networkstatus.py @@ -9,8 +9,11 @@ class BitmessageTest_NetworkTest(BitmessageTestCase): def test_network(self): """Switch to network window""" - QTest.qWait(1000) - self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.networkstatus) - QTest.qWait(1200) - print("\n Test Pass :--> Network Functionality Working Well! \n") - return 1 + try: + QTest.qWait(1000) + self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.networkstatus) + QTest.qWait(1200) + print("\n Test Pass :--> Network Functionality Working Well! \n") + return 1 + except: + print("\n Test Fail :--> Network Functionality Failed! \n") diff --git a/src/graphicaltesting/test_settingwindow.py b/src/graphicaltesting/test_settingwindow.py index cd2ed89a..efc68afd 100644 --- a/src/graphicaltesting/test_settingwindow.py +++ b/src/graphicaltesting/test_settingwindow.py @@ -17,7 +17,7 @@ class BitmessageTest_SettingWindowTest(BitmessageTestCase): def test_settingwindow(self): """Triggers the setting window""" self.myapp.ui.tabWidget.setCurrentWidget(self.myapp.ui.inbox) - QTest.qWait(1700) + QTest.qWait(1500) dialog = dialogs.SettingsDialog(self.myapp, firstrun=self.myapp._firstrun) self.language_change(dialog) QTest.qWait(300) diff --git a/src/graphicaltesting/testinitialization.py b/src/graphicaltesting/testinitialization.py index 02cef716..720ffc6f 100644 --- a/src/graphicaltesting/testinitialization.py +++ b/src/graphicaltesting/testinitialization.py @@ -7,30 +7,27 @@ import test_blackwhitelist import test_chans import test_messagesend import test_networkstatus -import test_settingwindow import test_quit +import test_settingwindow +import test_inbox_popmenu from testloader import BitmessageTestCase def test_initialize(myapp): - """Test Loader""" + """Inititalizing the test cases""" suite = unittest.TestSuite() suite.addTest( - BitmessageTestCase.bitmessage_testloader(test_addressgeneration.BitmessageTest_AddressGeneration, myapp=myapp) - ) + BitmessageTestCase.bitmessage_testloader(test_addressgeneration.BitmessageTest_AddressGeneration, myapp=myapp)) suite.addTest( - BitmessageTestCase.bitmessage_testloader(test_messagesend.BitmessageTest_MessageTesting, myapp=myapp) - ) + BitmessageTestCase.bitmessage_testloader(test_messagesend.BitmessageTest_MessageTesting, myapp=myapp)) suite.addTest( - BitmessageTestCase.bitmessage_testloader(test_addsubscription.BitmessageTest_AddSubscription, myapp=myapp) - ) + BitmessageTestCase.bitmessage_testloader(test_addsubscription.BitmessageTest_AddSubscription, myapp=myapp)) suite.addTest(BitmessageTestCase.bitmessage_testloader(test_networkstatus.BitmessageTest_NetworkTest, myapp=myapp)) suite.addTest( - BitmessageTestCase.bitmessage_testloader(test_blackwhitelist.BitmessageTest_BlackandWhiteList, myapp=myapp) - ) + BitmessageTestCase.bitmessage_testloader(test_blackwhitelist.BitmessageTest_BlackandWhiteList, myapp=myapp)) suite.addTest(BitmessageTestCase.bitmessage_testloader(test_chans.BitmessageTest_ChansTest, myapp=myapp)) suite.addTest( - BitmessageTestCase.bitmessage_testloader(test_settingwindow.BitmessageTest_SettingWindowTest, myapp=myapp) - ) + BitmessageTestCase.bitmessage_testloader(test_settingwindow.BitmessageTest_SettingWindowTest, myapp=myapp)) + suite.addTest(BitmessageTestCase.bitmessage_testloader(test_inbox_popmenu.BitmessageTest_Inbox_PopMenu, myapp=myapp)) suite.addTest(BitmessageTestCase.bitmessage_testloader(test_quit.BitmessageTest_QuitTest, myapp=myapp)) unittest.TextTestRunner().run(suite) diff --git a/src/graphicaltesting/testloader.py b/src/graphicaltesting/testloader.py index 8d21dd6b..580811f2 100644 --- a/src/graphicaltesting/testloader.py +++ b/src/graphicaltesting/testloader.py @@ -11,7 +11,7 @@ class BitmessageTestCase(unittest.TestCase): @staticmethod def bitmessage_testloader(testcaseclass, myapp=None): - """Test Loader""" + """Method responsible for loading test""" testnames = unittest.TestLoader().getTestCaseNames(testcaseclass) suite = unittest.TestSuite() for name in testnames: