Example #1
0
 def test_quit(self):
     """
     This function deals whether the server closing 
     the TCP connection between client and server in a
     proper way
     """
     user_test = CommandHandler()
     user_test.register('test', '12343535373')
     user_test.login('test', '12343535373')
     user_test.quit()
     expected_result = "\nLogged Out"
     obtained_result = user_test.quit()
     self.assertEqual(expected_result, obtained_result)
     shutil.rmtree(os.path.join("Root/"))
     shutil.rmtree("AccessSession/")
Example #2
0
    def test_login(self):
        """
        This function deals with test for login data
        """

        user_test = CommandHandler()
        user_test.register('test', '123456737')
        expected_result = ["\nWrong Password, try again"]
        obtained_result = []
        tests = [['test', '12345678']]
        for test in tests:
            obtained_result.append(user_test.login(test[0], test[1]))
        user_test.quit()
        self.assertListEqual(obtained_result, expected_result)
        shutil.rmtree(os.path.join("Root/"))
        shutil.rmtree("AccessSession/")