Skip to content

Commit 59e2e96

Browse files
committed
v1.3.1 - fix tests
oops
1 parent 803df37 commit 59e2e96

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from ui_form import Ui_App # generate ui_form.py: pyside6-uic form.ui -o ui_form.py
4242
from validateHosts import validateHostsFile
4343

44-
__version__ = "1.3.0"
44+
__version__ = "1.3.1"
4545

4646
TIMEOUT = 60
4747
ALL_EXCEPTIONS = (

test_hosts_validation.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,48 +23,48 @@ def test_valid_hosts():
2323
0.0.0.0 blockedwebsite.com
2424
127.0.0.1 anotherexample.com
2525
"""
26-
assert validateHostsFile(HOSTS)
26+
assert validateHostsFile(HOSTS)[0]
2727

2828

2929
def test_invalid_ipv4_hosts():
3030
HOSTS = """
3131
256.255.255.255 localhost
3232
::1 localhost
3333
"""
34-
assert not validateHostsFile(HOSTS)
34+
assert not validateHostsFile(HOSTS)[0]
3535

3636

3737
def test_invalid_ipv6_hosts():
3838
HOSTS = """
3939
127.0.0.1 localhost
4040
:1 localhost
4141
"""
42-
assert not validateHostsFile(HOSTS)
42+
assert not validateHostsFile(HOSTS)[0]
4343

4444

4545
def test_invalid_syntax():
4646
HOSTS = """
4747
google.com 0.0.0.0
4848
"""
49-
assert not validateHostsFile(HOSTS)
49+
assert not validateHostsFile(HOSTS)[0]
5050

5151

5252
def test_empty_hosts():
5353
HOSTS = ""
54-
assert validateHostsFile(HOSTS) # this should be valid!
54+
assert validateHostsFile(HOSTS)[0] # this should be valid!
5555

5656

5757
def 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

6565
def 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

Comments
 (0)