Skip to content

Commit ad64c09

Browse files
Added new test case.
1 parent d995300 commit ad64c09

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_webservice.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ def testapikeyexist(global_data, capsys):
1919
else:
2020
assert global_data["apikey"] != "YOUR_API_KEY"
2121

22+
def testfunctionexist(global_data):
23+
mbv = MailboxValidator.SingleValidation(global_data["apikey"])
24+
errors = []
25+
functions_list = ['ValidateEmail', 'DisposableEmail', 'FreeEmail']
26+
for x in range(len(functions_list)):
27+
# assert hasattr(mbv, functions_list[x]) == True, "Function did not exist."
28+
if (hasattr(mbv, functions_list[x]) == False):
29+
errors.append("Function " + functions_list[x] + " did not exist.")
30+
# assert no error message has been registered, else print messages
31+
assert not errors, "errors occured:\n{}".format("\n".join(errors))
32+
2233
def testvalidateemail(global_data):
2334
mbv = MailboxValidator.SingleValidation(global_data["apikey"])
2435
results = mbv.ValidateEmail('example@example.com')

0 commit comments

Comments
 (0)