from fmatch.saas.operators.is_business_email import is_business_email


def test_freemail():
    assert is_business_email("mike@gmail.com")["value"] is False
    assert is_business_email("mike@acme.com")["value"] is True
    assert is_business_email("corp@nationwidechildrens.org")["value"] is True


def test_reason_metadata():
    assert is_business_email("mike@gmail.com")["meta"]["reason"] == "freemail_domain"
    assert is_business_email("bad-email")["meta"]["reason"] == "invalid_email"

