File: test_001_alive.py

package info (click to toggle)
apache2 2.4.66-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 59,960 kB
  • sloc: ansic: 212,327; python: 13,830; perl: 11,307; sh: 7,266; php: 1,320; javascript: 1,314; awk: 749; makefile: 715; lex: 374; yacc: 161; xml: 2
file content (20 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pytest

from .env import H1Conf


class TestBasicAlive:

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

    # we expect to see the document from the generic server
    def test_h1_001_01(self, env):
        url = env.mkurl("https", "test1", "/alive.json")
        r = env.curl_get(url, 5)
        assert r.exit_code == 0, r.stderr + r.stdout
        assert r.response["json"]
        assert r.response["json"]["alive"] is True
        assert r.response["json"]["host"] == "test1"