Skip to content

Commit 693d4f1

Browse files
committed
chore: update tests
1 parent 57b6fec commit 693d4f1

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

tests/test_data_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
from commonpy.data_utils import *
1414

1515

16-
def test_slice():
17-
assert list(slice([1, 2, 3, 4], 2)) == [[1, 3], [2, 4]]
18-
assert list(slice([1, 2, 3, 4, 5], 2)) == [[1, 3, 5], [2, 4]]
16+
def test_sliced():
17+
assert list(sliced([1, 2, 3, 4], 2)) == [[1, 3], [2, 4]]
18+
assert list(sliced([1, 2, 3, 4, 5], 2)) == [[1, 3, 5], [2, 4]]
1919

2020

2121
def test_expanded_range():

tests/test_network_utils.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,17 @@ def test_net_bad_args():
4747

4848

4949
def test_hostname():
50-
assert hostname('https://foo.com') == 'foo.com'
51-
assert hostname('http://a.b.c') == 'a.b.c'
52-
assert hostname('file://a.b.c') == 'a.b.c'
53-
assert hostname('ftp://a.b.c') == 'a.b.c'
54-
assert hostname('gopher://a.b.c') == 'a.b.c'
55-
assert hostname('http://8server.com') == '8server.com'
56-
assert hostname('8server.com') == '8server.com'
57-
assert hostname('http://9292.nl/boo') == '9292.nl'
58-
assert hostname('http://123.345.234.655/a/b') == '123.345.234.655'
50+
assert hostname('https://foo.com') == 'foo.com'
51+
assert hostname('http://a.b.c') == 'a.b.c'
52+
assert hostname('file://a.b.c') == 'a.b.c'
53+
assert hostname('ftp://a.b.c') == 'a.b.c'
54+
assert hostname('gopher://a.b.c') == 'a.b.c'
55+
assert hostname('http://aserver.com') == 'aserver.com'
56+
assert hostname('aserver.com') == 'aserver.com'
57+
assert hostname('aserver.com/some/path') == 'aserver.com'
58+
assert hostname('http://9292.nl/boo') == '9292.nl'
59+
assert hostname('http://123.345.234.655/a/b') == '123.345.234.655'
60+
assert hostname('//mywebsite.com/resource.js') == 'mywebsite.com'
5961

6062

6163
def test_scheme():
@@ -64,10 +66,10 @@ def test_scheme():
6466
assert scheme('file://a.b.c') == 'file'
6567
assert scheme('ftp://a.b.c') == 'ftp'
6668
assert scheme('gopher://a.b.c') == 'gopher'
67-
assert scheme('8server.com') == ''
69+
assert scheme('aserver.com') == ''
6870

6971

7072
def test_netloc():
7173
assert netloc('https://foo.com') == 'foo.com'
72-
assert netloc('8server.com') == '8server.com'
74+
assert netloc('aserver.com') == 'aserver.com'
7375
assert netloc('ftp://a.b.c') == 'a.b.c'

0 commit comments

Comments
 (0)