How to use the tomcatmanager.models function in tomcatmanager

To help you get started, we’ve selected a few tomcatmanager examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tomcatmanager / tomcatmanager / tests / test_models.py View on Github external
def parse_apps(lines):
    apps = []
    for line in lines.splitlines():
        app = tm.models.TomcatApplication()
        app.parse(line)
        apps.append(app)
    return apps
github tomcatmanager / tomcatmanager / tests / test_manager_apps.py View on Github external
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)
github tomcatmanager / tomcatmanager / tests / test_models.py View on Github external
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
github tomcatmanager / tomcatmanager / tests / test_interactive_apps.py View on Github external
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