StrictDoc Documentation
tests/end2end/project_options/server_host/01_option_not_specified/test_case.py
Source file coverage
Path:
tests/end2end/project_options/server_host/01_option_not_specified/test_case.py
Lines:
35
Non-empty lines:
28
Non-empty lines covered with requirements:
28 / 28 (100.0%)
Functions:
2
Functions covered by requirements:
2 / 2 (100.0%)
1
"""
2
@relation(SDOC-SRS-119, scope=file)
3
"""
4
 
5
import os
6
 
7
from tests.end2end.e2e_case import E2ECase
8
from tests.end2end.helpers.screens.project_index.screen_project_index import (
9
    Screen_ProjectIndex,
10
)
11
from tests.end2end.server import SDocTestServer
12
 
13
path_to_this_test_file_folder = os.path.dirname(os.path.abspath(__file__))
14
 
15
 
16
class Test(E2ECase):
17
    def test(self):
18
        # Running this test can eventually cause conflicts when running
19
        # tests in parallel. Hoping that testing the server_host option is the
20
        # only case where we have to customize ports.
21
        custom_server_stderr_expectations = [
22
            "INFO:     Application startup complete.",
23
            "INFO:     Uvicorn running on http://127.0.0.1:5112 (Press CTRL+C to quit)",
24
        ]
25
 
26
        with SDocTestServer(
27
            input_path=path_to_this_test_file_folder,
28
            expectations=custom_server_stderr_expectations,
29
            port=5112,
30
        ) as test_server:
31
            self.open(test_server.get_host_and_port())
32
 
33
            screen_project_index = Screen_ProjectIndex(self)
34
            screen_project_index.assert_on_screen()
35
            screen_project_index.assert_header_project_name("Untitled Project")