Skip to content

Commit

Permalink
Added new test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
MailboxValidator authored Dec 17, 2020
1 parent d995300 commit ad64c09
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit ad64c09

Please sign in to comment.