Skip to content

Commit

Permalink
initialize DNS, per config file, in CI testing for some tests
Browse files Browse the repository at this point in the history
blacklists
chatcommands
findspam
spamhandling

autopull
  • Loading branch information
makyen committed Nov 17, 2024
1 parent ebf282c commit 8bae1fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/test_blacklists.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
import pytest

from blacklists import Blacklist, YAMLParserCIDR, YAMLParserASN, YAMLParserNS, load_blacklists
from helpers import files_changed, blacklist_integrity_check, not_regex_search_ascii_and_unicode
from helpers import files_changed, blacklist_integrity_check, not_regex_search_ascii_and_unicode, initiate_dns
from phone_numbers import NUMBER_REGEX, NUMBER_REGEX_START, NUMBER_REGEX_END, NUMBER_REGEX_MINIMUM_DIGITS, NUMBER_REGEX_MAXIMUM_DIGITS, \
process_numlist, get_maybe_north_american_not_in_normalized_but_in_all, is_digit_count_in_number_regex_range, matches_number_regex, \
matches_number_regex_start, matches_number_regex_end
from findspam import FindSpam

initiate_dns()


def test_number_lists():
errors = {}
Expand Down
3 changes: 3 additions & 0 deletions test/test_chatcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
from _Git_Windows import git
else:
from sh.contrib import git
from helpers import initiate_dns

from fake import Fake
from unittest.mock import patch

initiate_dns()


def rewrap_for_paramiterized_test_bisect():
def decorator(func):
Expand Down
4 changes: 3 additions & 1 deletion test/test_findspam.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from findspam import FindSpam, ip_for_url_host, get_ns_ips
import pytest
from classes import Post
from helpers import log
from helpers import log, initiate_dns

initiate_dns()


# noinspection PyMissingTypeHints
Expand Down
2 changes: 2 additions & 0 deletions test/test_spamhandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
from unittest.mock import MagicMock, call, ANY, DEFAULT
import chatcommunicate
from globalvars import GlobalVars
from helpers import initiate_dns


initiate_dns()
load_blacklists()
test_data_inputs = []
with open("test/data_test_spamhandling.txt", "r", encoding="utf-8") as f:
Expand Down

0 comments on commit 8bae1fd

Please sign in to comment.