Skip to content

Commit 4f4b127

Browse files
committed
added test for bad urls
1 parent f3759c7 commit 4f4b127

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
- name: bad-url
2-
url: google.com
1+
bad-url:
2+
url: https://www.testsite.io/services

unittests/test_mirrors.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ def test_mirror_init(systems_path, valid_mirrors):
3131
for mir in mirrors_obj.mirrors:
3232
assert mirrors_obj.mirrors[mir].get('enabled')
3333

34+
def test_mirror_init_bad_url(systems_path):
35+
"""Check that MirrorError is raised for a bad url."""
36+
37+
path = systems_path / "mirror-bad-url"
38+
39+
with pytest.raises(mirror.MirrorError):
40+
mirrors_obj = mirror.Mirrors(path)
41+
3442
def test_command_line_cache(systems_path):
3543
"""Check that adding a cache from the command line works."""
3644

0 commit comments

Comments
 (0)