Fix deprecation warnings.
This commit is contained in:
parent
68acfc986a
commit
936d90a5f5
|
@ -23,7 +23,7 @@ def get_ns(hostname) -> [str]:
|
||||||
def get_cname_record(hostname) -> Optional[str]:
|
def get_cname_record(hostname) -> Optional[str]:
|
||||||
"""Return the CNAME record if exists for a domain, WITHOUT the trailing period at the end"""
|
"""Return the CNAME record if exists for a domain, WITHOUT the trailing period at the end"""
|
||||||
try:
|
try:
|
||||||
answers = _get_dns_resolver().query(hostname, "CNAME")
|
answers = _get_dns_resolver().resolve(hostname, "CNAME")
|
||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ def get_mx_domains(hostname) -> [(int, str)]:
|
||||||
domain name ends with a "." at the end.
|
domain name ends with a "." at the end.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
answers = _get_dns_resolver().query(hostname, "MX")
|
answers = _get_dns_resolver().resolve(hostname, "MX")
|
||||||
except Exception:
|
except Exception:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ _include_spf = "include:"
|
||||||
def get_spf_domain(hostname) -> [str]:
|
def get_spf_domain(hostname) -> [str]:
|
||||||
"""return all domains listed in *include:*"""
|
"""return all domains listed in *include:*"""
|
||||||
try:
|
try:
|
||||||
answers = _get_dns_resolver().query(hostname, "TXT")
|
answers = _get_dns_resolver().resolve(hostname, "TXT")
|
||||||
except Exception:
|
except Exception:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ def get_spf_domain(hostname) -> [str]:
|
||||||
def get_txt_record(hostname) -> [str]:
|
def get_txt_record(hostname) -> [str]:
|
||||||
"""return all domains listed in *include:*"""
|
"""return all domains listed in *include:*"""
|
||||||
try:
|
try:
|
||||||
answers = _get_dns_resolver().query(hostname, "TXT")
|
answers = _get_dns_resolver().resolve(hostname, "TXT")
|
||||||
except Exception:
|
except Exception:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
from deprecated import deprecated
|
|
||||||
|
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
|
|
||||||
from app.config import PAGE_LIMIT
|
from app.config import PAGE_LIMIT
|
||||||
|
@ -9,7 +7,6 @@ from app.models import User, ApiKey, Alias, Contact, EmailLog, Mailbox
|
||||||
from tests.utils import login
|
from tests.utils import login
|
||||||
|
|
||||||
|
|
||||||
@deprecated
|
|
||||||
def test_get_aliases_error_without_pagination(flask_client):
|
def test_get_aliases_error_without_pagination(flask_client):
|
||||||
user = User.create(
|
user = User.create(
|
||||||
email="a@b.c",
|
email="a@b.c",
|
||||||
|
@ -31,7 +28,6 @@ def test_get_aliases_error_without_pagination(flask_client):
|
||||||
assert r.json["error"]
|
assert r.json["error"]
|
||||||
|
|
||||||
|
|
||||||
@deprecated
|
|
||||||
def test_get_aliases_with_pagination(flask_client):
|
def test_get_aliases_with_pagination(flask_client):
|
||||||
user = User.create(
|
user = User.create(
|
||||||
email="a@b.c",
|
email="a@b.c",
|
||||||
|
@ -79,7 +75,6 @@ def test_get_aliases_with_pagination(flask_client):
|
||||||
assert len(r.json["aliases"]) == 2
|
assert len(r.json["aliases"]) == 2
|
||||||
|
|
||||||
|
|
||||||
@deprecated
|
|
||||||
def test_get_aliases_query(flask_client):
|
def test_get_aliases_query(flask_client):
|
||||||
user = User.create(
|
user = User.create(
|
||||||
email="a@b.c", password="password", name="Test User", activated=True
|
email="a@b.c", password="password", name="Test User", activated=True
|
||||||
|
|
Loading…
Reference in a new issue