示例#1
0
    def test_no_dashes_on_end(self):
        assert docker_wrapper.generate_hostname("beep", "foobar-") == "beep-foobar"

        hostname = docker_wrapper.generate_hostname(
            "reallllllllllllllylooooooooooooooong", "reallyreallylongid0123--abc"
        )
        assert hostname == "reallllllllllllllylooooooooooooooong-reallyreallylongid0123"
        assert len(hostname) == 59
示例#2
0
    def test_no_dashes_on_end(self):
        assert docker_wrapper.generate_hostname('beep', 'foobar-') == 'beep-foobar'

        hostname = docker_wrapper.generate_hostname(
            'reallllllllllllllylooooooooooooooong',
            'reallyreallylongid012345--abc',
        )
        assert hostname == 'reallllllllllllllylooooooooooooooong-reallyreallylongid012345'
        assert len(hostname) == 61
示例#3
0
 def test_truncate(self):
     hostname = docker_wrapper.generate_hostname(
         'reallllllllllllllylooooooooooooooong',
         'reallyreallylongidsssssssssssssssssssssssss',
     )
     assert hostname == 'reallllllllllllllylooooooooooooooong-reallyreallylongidsssss'
     assert len(hostname) == 60
示例#4
0
 def test_truncate(self):
     hostname = docker_wrapper.generate_hostname(
         "reallllllllllllllylooooooooooooooong",
         "reallyreallylongidsssssssssssssssssssssssss",
     )
     assert (hostname ==
             "reallllllllllllllylooooooooooooooong-reallyreallylongidsssss")
     assert len(hostname) == 60
示例#5
0
 def test_symbols(self):
     hostname = docker_wrapper.generate_hostname(
         'first.part.matters', 'chronos:can_do!s0me weird-stuff')
     assert hostname == 'first-chronos-can-do-s0me-weird-stuff'
示例#6
0
 def test_simple(self):
     hostname = docker_wrapper.generate_hostname(
         'first.part.matters', 'what.only.matters.is.lastpart')
     assert hostname == 'first-lastpart'
示例#7
0
 def test_simple(self):
     hostname = docker_wrapper.generate_hostname(
         "first.part.matters", "what.only.matters.is.lastpart"
     )
     assert hostname == "first-lastpart"
示例#8
0
 def test_symbols(self):
     hostname = docker_wrapper.generate_hostname(
         "first.part.matters", "anything:can_do!s0me weird-stuff")
     assert hostname == "first-anything-can-do-s0me-weird-stuff"