Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_directory_and_version_empty():
ta = tm.models.TomcatApplication()
assert ta.directory_and_version is None
def test_parse_version():
line = '/shiny:stopped:17:shiny##v2.0.6'
ta = tm.models.TomcatApplication()
ta.parse(line)
assert ta.path == '/shiny'
assert ta.state == tm.application_states.stopped
assert ta.sessions == 17
assert ta.directory == 'shiny'
assert ta.version == 'v2.0.6'
assert ta.directory_and_version == 'shiny##v2.0.6'
def test_str_without_version():
line = '/shiny:running:8:shiny'
ta = tm.models.TomcatApplication()
ta.parse(line)
assert str(ta) == line
def test_str_with_version():
line = '/shiny:stopped:17:shiny##v2.0.6'
ta = tm.models.TomcatApplication()
ta.parse(line)
assert str(ta) == line