Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_main.py « certbot_tests « certbot_integration_tests « certbot-ci - github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5b0981b364bf3eae5d3ac993d5c6a1ac2dee2d1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import requests
import urllib3

import pytest

from certbot_integration_tests.certbot_tests import context as certbot_context


@pytest.fixture()
def context(request):
    # Fixture request is a built-in pytest fixture describing current test request.
    integration_test_context = certbot_context.IntegrationTestsContext(request)
    try:
        yield integration_test_context
    finally:
        integration_test_context.cleanup()


def test_hello_1(context):
    assert context.http_01_port
    assert context.tls_alpn_01_port
    try:
        response = requests.get(context.directory_url, verify=False)
        response.raise_for_status()
        assert response.json()
        response.close()
    except urllib3.exceptions.InsecureRequestWarning:
        pass


def test_hello_2(context):
    assert context.http_01_port
    assert context.tls_alpn_01_port
    try:
        response = requests.get(context.directory_url, verify=False)
        response.raise_for_status()
        assert response.json()
        response.close()
    except urllib3.exceptions.InsecureRequestWarning:
        pass