Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse_apps(lines):
apps = []
for line in lines.splitlines():
app = tm.models.TomcatApplication()
app.parse(line)
apps.append(app)
return apps
def test_list(self, tomcat):
r = tomcat.list()
self.info_assertions(r)
assert isinstance(r.apps, list)
assert isinstance(r.apps[0], tm.models.TomcatApplication)
def test_parse_root():
line = '/:running:0:ROOT'
ta = tm.models.TomcatApplication()
ta.parse(line)
assert ta.path == '/'
assert ta.state == tm.application_states.running
assert ta.sessions == 0
assert ta.directory == 'ROOT'
assert ta.version is None
assert ta.directory_and_version == ta.directory
def parse_apps(lines):
"""helper function to turn colon seperated text into objects"""
apps = []
for line in lines.splitlines():
app = tm.models.TomcatApplication()
app.parse(line)
apps.append(app)
return apps