File: test_003_get.py

package info (click to toggle)
apache2 2.4.62-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 59,516 kB
  • sloc: ansic: 216,122; python: 15,147; perl: 11,308; sh: 6,449; php: 1,315; javascript: 1,314; awk: 749; makefile: 714; lex: 374; yacc: 161; xml: 2
file content (27 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (4)
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
import socket

import pytest

from .env import H1Conf


class TestGet:

    @pytest.fixture(autouse=True, scope='class')
    def _class_scope(self, env):
        H1Conf(env).add_vhost_cgi(
            proxy_self=True
        ).add_vhost_test1(
            proxy_self=True
        ).install()
        assert env.apache_restart() == 0

    # check SSL environment variables from CGI script
    def test_h1_003_01(self, env):
        url = env.mkurl("https", "cgi", "/hello.py")
        r = env.curl_get(url)
        assert r.response["status"] == 200
        assert r.response["json"]["protocol"] == "HTTP/1.1"
        assert r.response["json"]["https"] == "on"
        tls_version = r.response["json"]["ssl_protocol"]
        assert tls_version in ["TLSv1.2", "TLSv1.3"]