How to use the tomcatmanager.status_codes 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_manager.py View on Github external
def success_assertions(self, r):
        """
        Assertions for every command that should complete successfully.
        """
        assert r.status_code == tm.status_codes.ok, 'message from server: "{}"'.format(r.status_message)
        assert r.status_message != None
        assert r.status_message
        r.raise_for_status()
github tomcatmanager / tomcatmanager / src / tomcatmanager / models.py View on Github external
def ok(self):
        """
        :return: True if the request completed with no errors.

        For this property to return True:

        - The HTTP request must return a status code of ``200 OK``
        - The first line of the response from the Tomcat Server must begin with ``OK``.
        """
        return all([
            self.response != None,
            self.response.status_code == requests.codes.ok,
            self.status_code == tm.status_codes.ok,
            ])