Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions domaintools/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime, timedelta, timezone
from hashlib import sha1, sha256, md5
from hashlib import sha1, sha256
from hmac import new as hmac

import re
Expand All @@ -24,7 +24,7 @@
from domaintools.utils import validate_feeds_parameters


AVAILABLE_KEY_SIGN_HASHES = ["sha1", "sha256", "md5"]
AVAILABLE_KEY_SIGN_HASHES = ["sha1", "sha256"]


def delimited(items, character="|"):
Expand Down
11 changes: 10 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,20 @@ def test_exception_handling():
API("notauser", "notakey").domain_search("amazon").data()
with pytest.raises(
ValueError,
match=r"Invalid value 'notahash' for 'key_sign_hash'. Values available are sha1,sha256,md5",
match=r"Invalid value 'notahash' for 'key_sign_hash'. Values available are sha1,sha256",
):
API("notauser", "notakey", always_sign_api_key=True, key_sign_hash="notahash").domain_search("amazon")


@vcr.use_cassette
def test_md5_is_not_supported():
with pytest.raises(
ValueError,
match=r"Invalid value 'md5' for 'key_sign_hash'. Values available are sha1,sha256",
):
API("notauser", "notakey", always_sign_api_key=True, key_sign_hash="md5").domain_search("amazon")


@vcr.use_cassette
def test_rate_limiting():
domain_searches = ["google"] * 31
Expand Down
13 changes: 9 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
[tox]
envlist=py39, py310, py311
envlist =
py39,
py310,
py311
skip_missing_interpreters=true

[testenv]
passenv=
passenv =
TEST_USER
TEST_KEY
deps=
deps =
click==8.1.8
pytest
pytest-cov
httpx
vcrpy
rich
typer
.
commands=py.test -s --capture=sys --cov=domaintools --cov=domaintools_async tests
commands =
py.test -s --capture=sys --cov=domaintools --cov=domaintools_async tests
coverage html