How to use the webtest.http.StopableWSGIServer.create function in WebTest

To help you get started, we’ve selected a few WebTest 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 aptise / peter_sslers / peter_sslers / tests.py View on Github external
def tests_letsencrypt_api(self):
        self.testapp_http = StopableWSGIServer.create(
            self.testapp.app, port=SSL_TEST_PORT
        )
        self.testapp_http.wait()
        res = self.testapp.get(
            "/.well-known/admin/acme-order/new/automated", status=200
        )
        form = res.form
        form["account_key_file_pem"] = Upload(
            self._filepath_testfile(
                TEST_FILES["CertificateRequests"]["acme_test"]["account_key"]
            )
        )
        form["private_key_file_pem"] = Upload(
            self._filepath_testfile(
                TEST_FILES["CertificateRequests"]["acme_test"]["private_key"]
            )