From ad64c092c0b1c7d8ced6473f4fe6433dabbe5d3f Mon Sep 17 00:00:00 2001 From: MailboxValidator Date: Thu, 17 Dec 2020 16:52:14 +0800 Subject: [PATCH] Added new test case. --- tests/test_webservice.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_webservice.py b/tests/test_webservice.py index 065608e..2c02f51 100644 --- a/tests/test_webservice.py +++ b/tests/test_webservice.py @@ -19,6 +19,17 @@ def testapikeyexist(global_data, capsys): else: assert global_data["apikey"] != "YOUR_API_KEY" +def testfunctionexist(global_data): + mbv = MailboxValidator.SingleValidation(global_data["apikey"]) + errors = [] + functions_list = ['ValidateEmail', 'DisposableEmail', 'FreeEmail'] + for x in range(len(functions_list)): + # assert hasattr(mbv, functions_list[x]) == True, "Function did not exist." + if (hasattr(mbv, functions_list[x]) == False): + errors.append("Function " + functions_list[x] + " did not exist.") + # assert no error message has been registered, else print messages + assert not errors, "errors occured:\n{}".format("\n".join(errors)) + def testvalidateemail(global_data): mbv = MailboxValidator.SingleValidation(global_data["apikey"]) results = mbv.ValidateEmail('example@example.com')