summaryrefslogtreecommitdiff
path: root/cloudinit/distros/tests/test_init.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/distros/tests/test_init.py')
-rw-r--r--cloudinit/distros/tests/test_init.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/cloudinit/distros/tests/test_init.py b/cloudinit/distros/tests/test_init.py
index daa81ab8..40939133 100644
--- a/cloudinit/distros/tests/test_init.py
+++ b/cloudinit/distros/tests/test_init.py
@@ -109,15 +109,17 @@ class TestGetPackageMirrorInfo:
['http://%(region)s.in.hostname/should/be/filtered',
'http://but.not.in.the.path/%(region)s'],
['http://but.not.in.the.path/inv[lid']),
- ) + (
+ (None, '-some-region-',
+ ['http://-lead-ing.%(region)s.trail-ing-.example.com/ubuntu'],
+ ['http://lead-ing.some-region.trail-ing.example.com/ubuntu']),
+ ) + tuple(
# Dynamically generate a test case for each non-LDH
# (Letters/Digits/Hyphen) ASCII character, testing that it is
# substituted with a hyphen
- tuple(
- (None, 'fk{0}fake{0}1'.format(invalid_char),
- ['http://%(region)s/ubuntu'], ['http://fk-fake-1/ubuntu'])
- for invalid_char in INVALID_URL_CHARS))
- )
+ (None, 'fk{0}fake{0}1'.format(invalid_char),
+ ['http://%(region)s/ubuntu'], ['http://fk-fake-1/ubuntu'])
+ for invalid_char in INVALID_URL_CHARS
+ ))
def test_substitution(self, availability_zone, region, patterns, expected):
"""Test substitution works as expected."""
m_data_source = mock.Mock(