StrictDoc Documentation
tests/unit/strictdoc/backend/sdoc/test_dsl_passthrough_document_views.py
Source file coverage
Path:
tests/unit/strictdoc/backend/sdoc/test_dsl_passthrough_document_views.py
Lines:
49
Non-empty lines:
41
Non-empty lines covered with requirements:
41 / 41 (100.0%)
Functions:
1
Functions covered by requirements:
1 / 1 (100.0%)
1
"""
2
@relation(SDOC-SRS-136, scope=file)
3
"""
4
 
5
from strictdoc.backend.sdoc.models.document import SDocDocument
6
from strictdoc.backend.sdoc.reader import SDReader
7
from strictdoc.backend.sdoc.writer import SDWriter
8
 
9
 
10
def test_01_integrated_example(default_project_config):
11
    input_sdoc = """
12
[DOCUMENT]
13
TITLE: Test Doc
14
OPTIONS:
15
  VIEW_STYLE: Inline
16
  DEFAULT_VIEW: PRINT_VIEW
17
VIEWS:
18
- ID: PRINT_VIEW
19
  NAME: Print view
20
  TAGS:
21
  - OBJECT_TYPE: REQUIREMENT
22
    VISIBLE_FIELDS:
23
    - NAME: UID
24
      PLACEMENT: XYZ
25
    - NAME: STATEMENT
26
    - NAME: RATIONALE
27
- ID: SECOND_VIEW
28
  TAGS:
29
  - OBJECT_TYPE: REQUIREMENT
30
    VISIBLE_FIELDS:
31
    - NAME: TITLE
32
      PLACEMENT: ABC
33
    - NAME: STATEMENT
34
    - NAME: RATIONALE
35
  HIDDEN_TAGS:
36
  - SECOND_OBJ
37
""".lstrip()
38
 
39
    reader = SDReader()
40
 
41
    document = reader.read(input_sdoc)
42
    assert isinstance(document, SDocDocument)
43
 
44
    document: SDocDocument = reader.read(input_sdoc)
45
 
46
    writer = SDWriter(default_project_config)
47
    output = writer.write(document)
48
 
49
    assert input_sdoc == output