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
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
def test_truncate(self): hostname = docker_wrapper.generate_hostname( 'reallllllllllllllylooooooooooooooong', 'reallyreallylongidsssssssssssssssssssssssss', ) assert hostname == 'reallllllllllllllylooooooooooooooong-reallyreallylongidsssss' assert len(hostname) == 60
def test_truncate(self): hostname = docker_wrapper.generate_hostname( "reallllllllllllllylooooooooooooooong", "reallyreallylongidsssssssssssssssssssssssss", ) assert (hostname == "reallllllllllllllylooooooooooooooong-reallyreallylongidsssss") assert len(hostname) == 60
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'
def test_simple(self): hostname = docker_wrapper.generate_hostname( 'first.part.matters', 'what.only.matters.is.lastpart') assert hostname == 'first-lastpart'
def test_simple(self): hostname = docker_wrapper.generate_hostname( "first.part.matters", "what.only.matters.is.lastpart" ) assert hostname == "first-lastpart"
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"