예제 #1
0
    def test_GeneralQuery_DonaldTrump(self):
        """Test - able to assert the  General Query"""
        response = Response_from_API.input_value_json(self, self.inputstring_general_trump[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])
        response = Response_from_API.input_value_json(self, self.inputstring_general_trump[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            "Donald John Trump (born June 14, 1946) is the 45th and current President of the")))

        response = self.resposne_instance.input_value_json(self, self.inputstring_general_trump[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])
예제 #2
0
    def test_GeneralQuery_WiproHolmes(self):
        """Test - able to assert the  General Query"""
        response = Response_from_API.input_value_json(self, self.inputstring_general_holmes[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])
        response = Response_from_API.input_value_json(self, self.inputstring_general_holmes[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            "Wipro HOLMES  Artificial Intelligence Platform is a rich set of cognitive")))

        response = self.resposne_instance.input_value_json(self, self.inputstring_general_holmes[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])
예제 #3
0
    def test_GeneralQuery_IndiraGandhi(self):
        """Test - able to assert the  General Query"""
        response = Response_from_API.input_value_json(self, self.inputstring_general_gandhi[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])
        response = Response_from_API.input_value_json(self, self.inputstring_general_gandhi[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            "Indira Priyadarshini Gandhi was an Indian politician and central figure of the")))

        response = self.resposne_instance.input_value_json(self, self.inputstring_general_gandhi[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])
class TestNLU_BrowserInternetoutage(unittest.TestCase):
    """"
        To Test the 'BrowserInternetoutrange' intent
    """
    restClient = RestClient()
    expectedIntent = "BROWSER-INTERNETOUTAGE"
    input_request = [
        "Internet is not working in my laptop.", "Internet is very slow.",
        "I do not have internet access. Please help",
        "LAN cable is connected, but there is no internet access",
        "I am unable to connect to google or myWipro, please help to fix this issue."
    ]
    url = ConfigManager.nlu_url
    resposne_instance = Response_from_API()

    def test_NLUBot_BROWSER_INTERNETOUTAGE1(self):
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                self.input_request[0], "Browser"))
        actual_response = TestNLU_BrowserInternetoutage.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_BrowserInternetoutage.expectedIntent)

    def test_NLUBot_BROWSER_INTERNETOUTAGE2(self):
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                self.input_request[1], "Browser"))
        actual_response = TestNLU_BrowserInternetoutage.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_BrowserInternetoutage.expectedIntent)

    def test_NLUBot_BROWSER_INTERNETOUTAGE3(self):
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                self.input_request[2], "Browser"))
        actual_response = TestNLU_BrowserInternetoutage.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_BrowserInternetoutage.expectedIntent)

    def test_NLUBot_BROWSER_INTERNETOUTAGE4(self):
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                self.input_request[3], "Browser"))
        actual_response = TestNLU_BrowserInternetoutage.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_BrowserInternetoutage.expectedIntent)

    def test_NLUBot_BROWSER_INTERNETOUTAGE5(self):
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                self.input_request[4], "Browser"))
        actual_response = TestNLU_BrowserInternetoutage.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_BrowserInternetoutage.expectedIntent)
예제 #5
0
class ChatTest_GeneralQuery(unittest.TestCase):
    url = ConfigManager.chatbot_url
    restClient = RestClient()
    inputstring_general_gandhi = ["hi", "who is Indira Gandhi", "bye"]
    inputstring_general_trump = ["hi", "who is Donald Trump", "bye"]
    inputstring_general_holmes = ["hi", "what is wipro holmes", "bye"]
    resposne_instance = Response_from_API()

    def test_GeneralQuery_IndiraGandhi(self):
        """Test - able to assert the  General Query"""
        response = Response_from_API.input_value_json(self, self.inputstring_general_gandhi[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])
        response = Response_from_API.input_value_json(self, self.inputstring_general_gandhi[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            "Indira Priyadarshini Gandhi was an Indian politician and central figure of the")))

        response = self.resposne_instance.input_value_json(self, self.inputstring_general_gandhi[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])

    def test_GeneralQuery_DonaldTrump(self):
        """Test - able to assert the  General Query"""
        response = Response_from_API.input_value_json(self, self.inputstring_general_trump[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])
        response = Response_from_API.input_value_json(self, self.inputstring_general_trump[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            "Donald John Trump (born June 14, 1946) is the 45th and current President of the")))

        response = self.resposne_instance.input_value_json(self, self.inputstring_general_trump[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])

    def test_GeneralQuery_WiproHolmes(self):
        """Test - able to assert the  General Query"""
        response = Response_from_API.input_value_json(self, self.inputstring_general_holmes[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])
        response = Response_from_API.input_value_json(self, self.inputstring_general_holmes[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            "Wipro HOLMES  Artificial Intelligence Platform is a rich set of cognitive")))

        response = self.resposne_instance.input_value_json(self, self.inputstring_general_holmes[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])
    @staticmethod
    def suite():
        """TestProject for this class"""
        suite = unittest.TestLoader().loadTestsFromTestCase(ChatTest_GeneralQuery)
        unittest.TextTestRunner(verbosity=2).run(suite)
예제 #6
0
class ChatTest_MultilingualHindi(unittest.TestCase):
    url = ConfigManager.chatbot_url
    restClient = RestClient()
    inputstring_ticketstatus = ["hi", " टिकट की स्थिति क्या है?", "bye"]
    ticketID = ""

    resposne_instance = Response_from_API()

    def test_TicketQuery_TicketStatus_Valid(self):
        """To test - able to see the valid ticket status"""
        activeticket_id = ChatTest_GuidedTicketing.ticketID
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_ticketstatus[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])
        print "Returned value", ChatTest_GuidedTicketing.ticketID
        response = self.resposne_instance.input_value_json(
            self, activeticket_id + self.inputstring_ticketstatus[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue(
            (convertunicode_to_string.startswith('Following is the status:')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_ticketstatus[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_TicketQuery_TicketStatus_Invalid(self):
        """To test - able to see the invalid ticket status"""
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_ticketstatus[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, "ICN0000000 टिकट की स्थिति क्या है?")
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue(
            (convertunicode_to_string.startswith('Ticket Details not found')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_ticketstatus[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    @staticmethod
    def suite():
        """TestProject for this class"""
        suite = unittest.TestLoader().loadTestsFromTestCase(
            ChatTest_MultilingualHindi)
        unittest.TextTestRunner(verbosity=2).run(suite)
class TestNLU_OsDiskCleanup(unittest.TestCase):
    """"
        To Test the 'OSDiskCleanup' intent
    """
    restClient = RestClient()
    expectedIntent = "OS-DISKCLEANUP"
    url = ConfigManager.nlu_url
    resposne_instance = Response_from_API()

    def test_NLUBot_OS_DISKCLEANUP1(self):
        input_request = "My Disk space showing as full. Please help to fix this."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(input_request, "OS"))
        actual_response = TestNLU_OsDiskCleanup.restClient.post(self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsDiskCleanup.expectedIntent)

    def test_NLUBot_OS_DISKCLEANUP2(self):
        input_request = "My computer runs out of space."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(input_request, "OS"))
        actual_response = TestNLU_OsDiskCleanup.restClient.post(self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsDiskCleanup.expectedIntent)

    def test_NLUBot_OS_DISKCLEANUP3(self):
        input_request = "My system is very slow due to low disk space. Please help."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(input_request, "OS"))
        actual_response = TestNLU_OsDiskCleanup.restClient.post(self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsDiskCleanup.expectedIntent)

    def test_NLUBot_OS_DISKCLEANUP4(self):
        input_request = "Please help to clean my system."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(input_request, "OS"))
        actual_response = TestNLU_OsDiskCleanup.restClient.post(self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsDiskCleanup.expectedIntent)

    def test_NLUBot_OS_DISKCLEANUP5(self):
        input_request = "I am getting low disk space warning. Please help"
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(input_request, "OS"))
        actual_response = TestNLU_OsDiskCleanup.restClient.post(self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsDiskCleanup.expectedIntent)
예제 #8
0
class ChatTest_GuidedTicketing(unittest.TestCase):
    url = ConfigManager.chatbot_url
    restClient = RestClient()
    inputstring_newticket_serviceDesk = [
        "hi", "please raise a ticket for me", "mywipro is not working",
        "Service Desk", "bye"
    ]
    inputstring_newticket_desktopService = [
        "hi", "please raise a ticket for me", "my keyboard is not working",
        "Desktop Customer Support", "bye"
    ]
    ticketID = ""

    resposne_instance = Response_from_API()

    def test_GuidedTicketing_NewTicket_ServiceDesk(self):
        """Test - able to raise Service now ticket """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_serviceDesk[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_serviceDesk[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            'Please provide the ticket description to raise the ticket in servicenow.'
        )))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_serviceDesk[2])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            'Please select a category from the options: Custom Application Support,Service Desk'
        )))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_serviceDesk[3])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')

        ChatTest_GuidedTicketing.ticketID = convertunicode_to_string[211:222]
        self.assertTrue((convertunicode_to_string.startswith(
            'Ticket has been created in servicenow with following details:')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_serviceDesk[4])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_GuidedTicketing_NewTicket_DesktopService(self):
        """Test - able to raise Service now ticket """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_desktopService[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_desktopService[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            'Please provide the ticket description to raise the ticket in servicenow.'
        )))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_desktopService[2])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            'Please select a category from the options: Desktop/Laptop Customer Support,Service Desk'
        )))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_desktopService[3])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')

        ChatTest_GuidedTicketing.ticketID = convertunicode_to_string[211:222]
        self.assertTrue((convertunicode_to_string.startswith(
            'Ticket has been created in servicenow with following details:')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_newticket_desktopService[4])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    @staticmethod
    def get_active_ticketID():
        """id of the ticket in Service now"""
        return ChatTest_GuidedTicketing.ticketID

    @staticmethod
    def suite():
        """TestProject for this class"""
        suite = unittest.TestLoader().loadTestsFromTestCase(
            ChatTest_GuidedTicketing)
        unittest.TextTestRunner(verbosity=2).run(suite)
class TestNLU_OsUsbconfig(unittest.TestCase):
    """"
        To Test the 'USBConfig' intent
    """
    restClient = RestClient()
    expectedIntent = "OS-USBCONFIG"
    expectedEntity = "AccessType"
    url = ConfigManager.nlu_url
    resposne_instance = Response_from_API()
    input_request = [
        "Please provide USB read and write access.",
        "I want to connect USB in my laptop, please provide access.",
        "Write access required for my usb.", "Configure usb in my system.",
        "Provide read and write access for my pendrive"
    ]
    accuracy = []
    failure_message = []
    testcase_result = []

    def test_NLUBot_OS_USBCONFIG1(self):
        failureException = ""
        try:

            data = json.dumps(
                self.resposne_instance.input_value_json_nlu(
                    self.input_request[0], "OS"))
            expectedEntityValue = "read/write"
            actual_response = self.restClient.post(self.url, data)
            self.assertEquals(actual_response["intent"], self.expectedIntent,
                              "Expecting Intent is OS-USBCONFIG")
            self.assertEquals(actual_response["entities"][0]['entity'],
                              self.expectedEntity,
                              "Expecting Entity is AccessType")
            self.assertEquals(actual_response["entities"][0]['value'],
                              expectedEntityValue,
                              "Expecting Entity Value is read and write")
        except AssertionError as error:
            failureException = error.args[0]
        finally:
            if failureException is None:
                self.testcase_result.append("Pass")
                self.failure_message.append("None")
            else:
                self.testcase_result.append("Fail")
                self.failure_message.append(failureException)

    def test_NLUBot_OS_USBCONFIG2(self):
        failureException = ""
        try:

            data = json.dumps(
                self.resposne_instance.input_value_json_nlu(
                    self.input_request[1], "OS"))
            actual_response = self.restClient.post(self.url, data)
            self.assertEquals(actual_response["intent"], self.expectedIntent,
                              "Expecting intent is OS-USBCONFIG")
            self.assertEquals(actual_response["entities"][0]['entity'],
                              self.expectedEntity,
                              "Expecting Entity is AccessType")
        except AssertionError as error:
            failureException = error.args[0]
        finally:
            if failureException is None:
                self.testcase_result.append("Pass")
                self.failure_message.append("None")
            else:
                self.testcase_result.append("Fail")
                self.failure_message.append(failureException)

    def test_NLUBot_OS_USBCONFIG3(self):
        failureException = ""
        try:

            data = json.dumps(
                self.resposne_instance.input_value_json_nlu(
                    self.input_request[2], "OS"))
            actual_response = self.restClient.post(self.url, data)
            self.assertEquals(actual_response["intent"], self.expectedIntent,
                              "Expecting Intent is OS-USBCONFIG")
        except AssertionError as error:
            failureException = error.args[0]
        finally:
            if failureException is None:
                self.testcase_result.append("Pass")
                self.failure_message.append("None")
            else:
                self.testcase_result.append("Fail")
                self.failure_message.append(failureException)

    def test_NLUBot_OS_USBCONFIG4(self):
        failureException = ""
        try:

            data = json.dumps(
                self.resposne_instance.input_value_json_nlu(
                    self.input_request[3], "OS"))
            actual_response = self.restClient.post(self.url, data)
            self.assertEquals(actual_response["intent"], self.expectedIntent,
                              "Expecting Intent is OS-USBCONFIG")
            self.assertEquals(actual_response["entities"][0]['entity'],
                              self.expectedEntity,
                              "Expecting Entity is AccessType")
        except AssertionError as error:
            failureException = error.args[0]
        finally:
            if failureException is None:
                self.testcase_result.append("Pass")
                self.failure_message.append("None")
            else:
                self.testcase_result.append("Fail")
                self.failure_message.append(failureException)

    def test_NLUBot_OS_USBCONFIG5(self):
        failureException = ""
        try:

            data = json.dumps(
                self.resposne_instance.input_value_json_nlu(
                    self.input_request[4], "OS"))
            expectedEntityValue = "read/write"
            actual_response = self.restClient.post(self.url, data)
            self.assertEquals(actual_response["intent"], self.expectedIntent,
                              "Expecting Intent is OS-USBCONFIG")
            self.assertEquals(actual_response["entities"][0]['entity'],
                              self.expectedEntity,
                              "Expecting Entity  is AccessType")
            self.assertEquals(actual_response["entities"][0]['value'],
                              expectedEntityValue,
                              "Expecting Entity Value is read and write")
        except AssertionError as error:
            failureException = error.args[0]
        finally:
            if failureException is None:
                self.testcase_result.append("Pass")
                self.failure_message.append("None")
            else:
                self.testcase_result.append("Fail")
                self.failure_message.append(failureException)

    @staticmethod
    def metadata_INTERNETOTAGE():
        return TestNLU_OsUsbconfig.expectedIntent

    @staticmethod
    def metadata_description():
        return TestNLU_OsUsbconfig.input_request

    @staticmethod
    def metadata_accuracy():
        return TestNLU_OsUsbconfig.accuracy

    @staticmethod
    def metadata_failure_message():
        return TestNLU_OsUsbconfig.failure_message

    @staticmethod
    def metadata_testcase_result():
        return TestNLU_OsUsbconfig.testcase_result

    @staticmethod
    def suite():
        return unittest.TestLoader().loadTestsFromTestCase(TestNLU_OsUsbconfig)
class DetailedTest_01_SOP_Leave_Spellcheck(unittest.TestCase):
    url = ConfigManager.chatbot_url
    restClient = RestClient()
    inputstring_hrpolicy_leave_spellcheck1 = [
        "hi", "hw many leves do i have while in probation", "bye"
    ]
    inputstring_hrpolicy_leave_spellcheck2 = [
        "hi", "how may leaves do i hve while in prbation", "bye"
    ]
    inputstring_hrpolicy_leave_spellcheck3 = [
        "hi", "ho many leves do i have whle in probtion", "bye"
    ]
    inputstring_hrpolicy_leave_spellcheck4 = [
        "hi", "how mny leavs do i have while in probaton", "bye"
    ]

    resposne_instance = Response_from_API()

    def test_SOP_HRPolicy_MediClaim_SpellCheck1(self):
        """To test the SOP_MASClaim Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck1[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck1[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((
            convertunicode_to_string.startswith('1.6 Leaves during probation'))
                        and (convertunicode_to_string.endswith(
                            'start earning 1.75 days of leave every month.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck1[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPolicy_MediClaim_SpellCheck2(self):
        """To test the SOP_MediClaim Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck2[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck2[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((
            convertunicode_to_string.startswith('1.6 Leaves during probation'))
                        and (convertunicode_to_string.endswith(
                            'start earning 1.75 days of leave every month.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck2[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPolicy_MediClaim_SpellCheck3(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck3[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck3[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((
            convertunicode_to_string.startswith('1.6 Leaves during probation'))
                        and (convertunicode_to_string.endswith(
                            'start earning 1.75 days of leave every month.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck3[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPolicy_MediClaim_SpellCheck4(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck4[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck4[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((
            convertunicode_to_string.startswith('1.6 Leaves during probation'))
                        and (convertunicode_to_string.endswith(
                            'start earning 1.75 days of leave every month.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave_spellcheck4[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    @staticmethod
    def suite():
        """TestProject for this class"""
        suite = unittest.TestLoader().loadTestsFromTestCase(
            DetailedTest_01_SOP_Leave_Spellcheck)
        unittest.TextTestRunner(verbosity=2).run(suite)
예제 #11
0
class DetailedTest_01_SOP_MediClaim_Spellcheck(unittest.TestCase):
    url = ConfigManager.chatbot_url
    restClient = RestClient()
    inputstring_hrpolicy_mediclaim_spellcheck1 = [
        "hi", "hw can i claim for mecal reimbursement?", "bye"
    ]
    inputstring_hrpolicy_mediclaim_spellcheck2 = [
        "hi", "how can i clam for mdical reimbursement?", "bye"
    ]
    inputstring_hrpolicy_mediclaim_spellcheck3 = [
        "hi", "ow can i claim for medical reimrsement?", "bye"
    ]
    inputstring_hrpolicy_mediclaim_spellcheck4 = [
        "hi", "how can i caim for medical rebursement?", "bye"
    ]

    resposne_instance = Response_from_API()

    def test_SOP_HRPolicy_MediClaim_SpellCheck1(self):
        """To test the SOP_MASClaim Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck1[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck1[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue(
            (convertunicode_to_string.startswith('1.4 Allowed under MAS'))
            and (convertunicode_to_string.endswith(
                'diagnosis and treatment of specified illness.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck1[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPolicy_MediClaim_SpellCheck2(self):
        """To test the SOP_MediClaim Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck2[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck2[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue(
            (convertunicode_to_string.startswith('1.4 Allowed under MAS'))
            and (convertunicode_to_string.endswith(
                'diagnosis and treatment of specified illness.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck2[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPolicy_MediClaim_SpellCheck3(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck3[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck3[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue(
            (convertunicode_to_string.startswith('1.4 Allowed under MAS'))
            and (convertunicode_to_string.endswith(
                'diagnosis and treatment of specified illness.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck3[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPolicy_MediClaim_SpellCheck4(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck4[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck4[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue(
            (convertunicode_to_string.startswith('1.4 Allowed under MAS'))
            and (convertunicode_to_string.endswith(
                'diagnosis and treatment of specified illness.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim_spellcheck4[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    @staticmethod
    def suite():
        """TestProject for this class"""
        suite = unittest.TestLoader().loadTestsFromTestCase(
            DetailedTest_01_SOP_MediClaim_Spellcheck)
        unittest.TextTestRunner(verbosity=2).run(suite)
예제 #12
0
class TestNLU_OsSoftwareInstall(unittest.TestCase):
    """"
        To Test the 'OsSoftwareInstall' intent
    """
    restClient = RestClient()
    expectedIntent = "SOFTWARE-INSTALL"
    expectedEntity = "softwareName"
    url = ConfigManager.nlu_url
    resposne_instance = Response_from_API()

    def test_NLUBot_OS_SOFTWAREINSTALL1(self):
        input_request = "Install 7zip Software in my laptop."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Software"))
        expectedEntityValue = "7zip"
        actual_response = TestNLU_OsSoftwareInstall.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsSoftwareInstall.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_OsSoftwareInstall.expectedEntity)
        self.assertEquals(actual_response["entities"][0]['value'],
                          expectedEntityValue)

    def test_NLUBot_OS_SOFTWAREINSTALL2(self):
        input_request = "I need a software to compress files."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Software"))
        expectedEntityValue = "7zip"
        actual_response = TestNLU_OsSoftwareInstall.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsSoftwareInstall.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_OsSoftwareInstall.expectedEntity)
        self.assertEquals(actual_response["entities"][0]['value'],
                          expectedEntityValue)

    def test_NLUBot_OS_SOFTWAREINSTALL3(self):
        input_request = "Configure 7zip Software on my machine."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Software"))
        expectedEntityValue = "7zip"
        actual_response = TestNLU_OsSoftwareInstall.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsSoftwareInstall.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_OsSoftwareInstall.expectedEntity)
        self.assertEquals(actual_response["entities"][0]['value'],
                          expectedEntityValue)

    def test_NLUBot_OS_SOFTWAREINSTALL4(self):
        input_request = "I want to install Microsoft office software."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Software"))
        expectedEntityValue = "msoffice"
        actual_response = TestNLU_OsSoftwareInstall.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsSoftwareInstall.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_OsSoftwareInstall.expectedEntity)
        self.assertEquals(actual_response["entities"][0]['value'],
                          expectedEntityValue)

    def test_NLUBot_OS_SOFTWAREINSTALL5(self):
        input_request = "Please install a software to decompress files."
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Software"))
        expectedEntityValue = "7zip"
        actual_response = TestNLU_OsSoftwareInstall.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_OsSoftwareInstall.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_OsSoftwareInstall.expectedEntity)
        self.assertEquals(actual_response["entities"][0]['value'],
                          expectedEntityValue)
class DetailedTest_01_SOP_AnnualLeave_Spellcheck(unittest.TestCase):
    url = ConfigManager.chatbot_url
    restClient = RestClient()
    inputstring_hrpolicy_annualleave_spellcheck1 = [
        "hi", "hw Annual leave encashment calculated ?", "bye"
    ]
    inputstring_hrpolicy_annualleave_spellcheck2 = [
        "hi", "How Annual leve encahment calcultd ?", "bye"
    ]
    inputstring_hrpolicy_annualleave_spellcheck3 = [
        "hi", "How Anual leave encashment calculated ?", "bye"
    ]
    inputstring_hrpolicy_annualleave_spellcheck4 = [
        "hi", "hw Annual leave encament clculated ?", "bye"
    ]

    resposne_instance = Response_from_API()

    def test_SOP_HRPlicy_AnnualLeave_SpellCheck1(self):
        """To test the SOP_MASClaim Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck1[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck1[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            '1.2 Annual leave encashment calculated'
        )) and (convertunicode_to_string.endswith(
            '(WBP + *Special Allowance + Provision for car for 1 month)) / 30')
                ))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck1[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPlicy_AnnualLeave_SpellCheck2(self):
        """To test the SOP_MediClaim Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck2[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck2[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            '1.2 Annual leave encashment calculated'
        )) and (convertunicode_to_string.endswith(
            '(WBP + *Special Allowance + Provision for car for 1 month)) / 30')
                ))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck2[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPlicy_AnnualLeave_SpellCheck3(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck3[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck3[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            '1.2 Annual leave encashment calculated'
        )) and (convertunicode_to_string.endswith(
            '(WBP + *Special Allowance + Provision for car for 1 month)) / 30')
                ))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck3[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPlicy_AnnualLeave_SpellCheck4(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck4[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck4[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            '1.2 Annual leave encashment calculated'
        )) and (convertunicode_to_string.endswith(
            '(WBP + *Special Allowance + Provision for car for 1 month)) / 30')
                ))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave_spellcheck4[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    @staticmethod
    def suite():
        """TestProject for this class"""
        suite = unittest.TestLoader().loadTestsFromTestCase(
            DetailedTest_01_SOP_AnnualLeave_Spellcheck)
        unittest.TextTestRunner(verbosity=2).run(suite)
class DetailedTest_01_SOP_WBSClaims_Spellcheck(unittest.TestCase):
    url = ConfigManager.chatbot_url
    restClient = RestClient()
    inputstring_wbsclaim_spellcheck1 = ["hi", "what is the ducation allowance as part of WBS?","bye"]
    inputstring_wbsclaim_spellcheck2 = ["hi", "what is the education allwnce as pat of WBS?", "bye"]
    inputstring_wbsclaim_spellcheck3 = ["hi", "wt is the educton lowance as part of WBS?", "bye"]
    inputstring_wbsclaim_spellcheck4 = ["hi", "wt is the eduction allownce as part of WBS?", "bye"]


    resposne_instance = Response_from_API()

    def test_SOP_HRPolicy_WBSClaims_SpellCheck1(self):
        """To test the SOP_MASClaim Query """
        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck1[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])

        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck1[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith('1.3 Education Allowance as part of WBS')) and (
            convertunicode_to_string.endswith('hostel fee could be produced once in a quarter.')))


        response = self.resposne_instance.input_value_json(self,self.inputstring_wbsclaim_spellcheck1[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])

    def test_SOP_HRPolicy_WBSClaims_SpellCheck2(self):
        """To test the SOP_MediClaim Query """
        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck2[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])

        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck1[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith('1.3 Education Allowance as part of WBS')) and (
            convertunicode_to_string.endswith('hostel fee could be produced once in a quarter.')))

        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck1[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])


    def test_SOP_HRPolicy_WBSClaims_SpellCheck3(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck3[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])

        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck1[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith('1.3 Education Allowance as part of WBS')) and (
            convertunicode_to_string.endswith('hostel fee could be produced once in a quarter.')))

        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck1[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])

    def test_SOP_HRPolicy_WBSClaims_SpellCheck4(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck4[0])
        self.assertEquals("Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
                          response['text'])

        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck4[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith('1.3 Education Allowance as part of WBS')) and (
            convertunicode_to_string.endswith('hostel fee could be produced once in a quarter.')))

        response = self.resposne_instance.input_value_json(self, self.inputstring_wbsclaim_spellcheck4[2])
        self.assertEquals("Thank you, have a Great Day.",
                          response['text'])

    @staticmethod
    def suite():
        """TestProject for this class"""
        suite = unittest.TestLoader().loadTestsFromTestCase(DetailedTest_01_SOP_WBSClaims_Spellcheck)
        unittest.TextTestRunner(verbosity=2).run(suite)
예제 #15
0
class TestNLU_ConfigureOutlook(unittest.TestCase):
    """"
        To Test the 'ConfigureOutlook' intent
    """
    restClient = RestClient()
    expectedIntent = "OUTLOOK-CONFIGURE"
    expectedEntity = "configtype"
    url = ConfigManager.nlu_url
    resposne_instance = Response_from_API()

    def test_NLUBot_CONFIGURE_OUTLOOOK1(self):
        input_request = "Please configure outlook in my laptop remotely"
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Outlook"))
        actual_response = TestNLU_ConfigureOutlook.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_ConfigureOutlook.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_ConfigureOutlook.expectedEntity)

    def test_NLUBot_CONFIGURE_OUTLOOOK2(self):
        input_request = "Configure Microsoft Outlook"
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Outlook"))
        actual_response = TestNLU_ConfigureOutlook.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_ConfigureOutlook.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_ConfigureOutlook.expectedEntity)

    def test_NLUBot_CONFIGURE_OUTLOOOK3(self):
        input_request = "Need to add PST in my outlook account"
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Outlook"))
        expectedEntityValue = "PST"
        actual_response = TestNLU_ConfigureOutlook.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_ConfigureOutlook.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_ConfigureOutlook.expectedEntity)
        self.assertEquals(actual_response["entities"][0]['value'],
                          expectedEntityValue)

    def test_NLUBot_CONFIGURE_OUTLOOOK4(self):
        input_request = "Configure new PST in my outlook"
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Outlook"))
        expectedEntityValue = "PST"
        actual_response = TestNLU_ConfigureOutlook.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_ConfigureOutlook.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_ConfigureOutlook.expectedEntity)
        self.assertEquals(actual_response["entities"][0]['value'],
                          expectedEntityValue)

    def test_NLUBot_CONFIGURE_OUTLOOOK5(self):
        input_request = "I need to get the outlook configured in my machine"
        data = json.dumps(
            self.resposne_instance.input_value_json_nlu(
                input_request, "Outlook"))
        actual_response = TestNLU_ConfigureOutlook.restClient.post(
            self.url, data)
        self.assertEquals(actual_response["intent"],
                          TestNLU_ConfigureOutlook.expectedIntent)
        self.assertEquals(actual_response["entities"][0]['entity'],
                          TestNLU_ConfigureOutlook.expectedEntity)
class ChatTest_SOP(unittest.TestCase):
    url = ConfigManager.chatbot_url
    restClient = RestClient()
    inputstring_hrpolicy_wbsclaim = [
        "hi", "what is the education allowance as part of WBS?", "bye"
    ]
    inputstring_hrpolicy_mediclaim = [
        "hi", "how can i claim for medical reimbursement?", "bye"
    ]
    inputstring_hrpolicy_leave = [
        "hi", "how many leaves do i have while in probation", "bye"
    ]
    inputstring_hrpolicy_annualleave = [
        "hi", "How Annual leave encashment calculated ?", "bye"
    ]

    resposne_instance = Response_from_API()

    def test_SOP_HRPolicy_WBSClaims(self):
        """To test the SOP_MASClaim Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_wbsclaim[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_wbsclaim[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue(
            (convertunicode_to_string.startswith(
                '1.3 Education Allowance as part of WBS'))
            and (convertunicode_to_string.endswith(
                'hostel fee could be produced once in a quarter.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_wbsclaim[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPolicy_Mediclaim(self):
        """To test the SOP_MediClaim Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue(
            (convertunicode_to_string.startswith('1.4 Allowed under MAS'))
            and (convertunicode_to_string.endswith(
                'diagnosis and treatment of specified illness.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_mediclaim[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_HRPolicy_Leave(self):
        """To test the SOP_LEave during probation Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((
            convertunicode_to_string.startswith('1.6 Leaves during probation'))
                        and (convertunicode_to_string.endswith(
                            'start earning 1.75 days of leave every month.')))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_leave[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    def test_SOP_Annual_Leave(self):
        """To test the SOP_AnnualLeave Query """
        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave[0])
        self.assertEquals(
            "Hi , I am your IT Bot. I can help you with your IT issues and policy queries.",
            response['text'])

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave[1])
        convertunicode_to_string = response['text'].encode('ascii', 'ignore')
        self.assertTrue((convertunicode_to_string.startswith(
            '1.2 Annual leave encashment calculated'
        )) and (convertunicode_to_string.endswith(
            '(WBP + *Special Allowance + Provision for car for 1 month)) / 30')
                ))

        response = self.resposne_instance.input_value_json(
            self, self.inputstring_hrpolicy_annualleave[2])
        self.assertEquals("Thank you, have a Great Day.", response['text'])

    @staticmethod
    def suite():
        """TestProject for this class"""
        suite = unittest.TestLoader().loadTestsFromTestCase(ChatTest_SOP)
        unittest.TextTestRunner(verbosity=2).run(suite)