@@ -23,48 +23,48 @@ def test_valid_hosts():
23230.0.0.0 blockedwebsite.com
2424127.0.0.1 anotherexample.com
2525"""
26- assert validateHostsFile (HOSTS )
26+ assert validateHostsFile (HOSTS )[ 0 ]
2727
2828
2929def test_invalid_ipv4_hosts ():
3030 HOSTS = """
3131256.255.255.255 localhost
3232::1 localhost
3333"""
34- assert not validateHostsFile (HOSTS )
34+ assert not validateHostsFile (HOSTS )[ 0 ]
3535
3636
3737def test_invalid_ipv6_hosts ():
3838 HOSTS = """
3939127.0.0.1 localhost
4040:1 localhost
4141"""
42- assert not validateHostsFile (HOSTS )
42+ assert not validateHostsFile (HOSTS )[ 0 ]
4343
4444
4545def test_invalid_syntax ():
4646 HOSTS = """
4747google.com 0.0.0.0
4848"""
49- assert not validateHostsFile (HOSTS )
49+ assert not validateHostsFile (HOSTS )[ 0 ]
5050
5151
5252def test_empty_hosts ():
5353 HOSTS = ""
54- assert validateHostsFile (HOSTS ) # this should be valid!
54+ assert validateHostsFile (HOSTS )[ 0 ] # this should be valid!
5555
5656
5757def test_hagezi_ultimate_uncompressed_hosts ():
5858 # time for a real test!
5959 HOSTS = requests .get (
6060 "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/hosts/ultimate.txt"
6161 ).text # this hosts file has over 700,000 entries 😵
62- assert validateHostsFile (HOSTS ) # should be valid
62+ assert validateHostsFile (HOSTS )[ 0 ] # should be valid
6363
6464
6565def test_hagezi_ultimate_compressed_hosts ():
6666 # another test just in case
6767 HOSTS = requests .get (
6868 "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/hosts/ultimate-compressed.txt"
6969 ).text
70- assert validateHostsFile (HOSTS ) # should also be valid
70+ assert validateHostsFile (HOSTS )[ 0 ] # should also be valid
0 commit comments