Merge "Add unit tests for bracket_ipv6"

This commit is contained in:
Jenkins 2016-11-23 15:21:01 +00:00 committed by Gerrit Code Review
commit 8352c9c664
1 changed files with 14 additions and 0 deletions

View File

@ -720,3 +720,17 @@ class TestReplaceLinks(TestCase):
}
self.assertEqual(expected, utils.relative_link_replacement(
self.link_replacement, current_dir))
class TestBracketIPV6(TestCase):
def test_basic(self):
result = utils.bracket_ipv6('::1')
self.assertEqual('[::1]', result)
def test_hostname(self):
result = utils.bracket_ipv6('hostname')
self.assertEqual('hostname', result)
def test_already_bracketed(self):
result = utils.bracket_ipv6('[::1]')
self.assertEqual('[::1]', result)