def prompt_for_email_verifier(): email = prompt_user("Please enter the email you'd like to check", '.*') return EmailVerifier(str(email))
def test_EmailVerifier_works_with_long_email(): assert 'Email is valid' == EmailVerifier('[email protected]'), 'Test Failed: Email should be valid'
def test_EmailVerifier_returns_str_argument(): assert isinstance(EmailVerifier('*****@*****.**'),str), 'Test Failed: Function does not return a string'
def test_EmailVerifier_works_with_basic_email(): assert 'Email is valid' == EmailVerifier('*****@*****.**'), 'Test Failed: Email should be valid'
def test_EmailVerifier_works_with_short_email(): assert 'Email is valid' == EmailVerifier('*****@*****.**'), 'Test Failed: Email should be valid'
def test_EmailVerifier_fails_with_invalid_symbols(): assert 'Email is not valid' == EmailVerifier('Forrest()[email protected]'), 'Test Failed: Email should not be valid'
def test_EmailVerifier_fails_with_invalid_symbols_in_domain(): assert 'Email is not valid' == EmailVerifier('ForrestGUMP@uf!l.uwu'), 'Test Failed: Email should not be valid'
def test_EmailVerifier_email_raises_exception_on_non_str_args(): with pytest.raises(TypeError): EmailVerifier(45) EmailVerifier(25.2) EmailVerifier(None)
def test_EmailVerifier_works_different_domains(): assert 'Email is valid' == EmailVerifier('Forrest**[email protected]'), 'Test Failed: Email should be valid'
def test_EmailVerifier_works_with_period_interally(): assert 'Email is valid' == EmailVerifier('*****@*****.**'), 'Test Failed: Email should be valid'
def test_EmailVerifier_works_with_starting_symbols(): assert 'Email is valid' == EmailVerifier('[email protected]'), 'Test Failed: Email should be valid'
def test_EmailVerifier_fails_with_starting_period(): assert 'Email is not valid' == EmailVerifier('*****@*****.**'), 'Test Failed: Email should not be valid'
def test_EmailVerifier_fails_with_ending_period(): assert 'Email is not valid' == EmailVerifier('*****@*****.**'), 'Test Failed: Email should not be valid'
def test_EmailVerifier_fails_with_starting_number(): assert 'Email is not valid' == EmailVerifier('*****@*****.**'), 'Test Failed: Email should not be valid'
def test_EmailVerifier_fails_with_consecutive_periods(): assert 'Email is not valid' == EmailVerifier('*****@*****.**'), 'Test Failed: Email should not be valid'
def email(): form = EmailForm() if form.validate_on_submit(): ret = EmailVerifier.Verify(form.email.data) flash(ret) return render_template('email.html', title='Verify Email', form=form)