Skip to content

Commit

Permalink
fix: rename test cases files to be more generic
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
  • Loading branch information
AleJo2995 committed Oct 5, 2023
1 parent 0f47692 commit dbf443a
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: tmp
valid:
from: null
to: null
x-trestle-template-type: arch-design
x-trestle-template-type: a
x-trestle-template-version: 1.0.0
---
# System architecture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: tmp
valid:
from: null
to: null
x-trestle-template-type: arch-design
x-trestle-template-type: a
x-trestle-template-version: 2.0.0
---
# System architecture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: tmp
valid:
from:
to:
x-trestle-template-type: cloud_security_baseline_checklist
x-trestle-template-type: b
x-trestle-template-version: 1.1.1
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ owner: tmp
valid:
from: null
to: null
x-trestle-template-type: arch-design
x-trestle-template-version: 1.0.0
x-trestle-template-type: a
x-trestle-template-version: 3.0.0
---
# System architecture

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: tmp
valid:
from:
to:
x-trestle-template-type: cloud_security_baseline_checklist
x-trestle-template-type: b
x-trestle-template-version: 1.0.0
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: tmp
valid:
from: null
to: null
x-trestle-template-type: arch-design
x-trestle-template-type: a
x-trestle-template-version: 1.0.0
---
# System architecture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: tmp
valid:
from:
to:
x-trestle-template-type: cloud_security_baseline_checklist
x-trestle-template-type: b
x-trestle-template-version: 1.0.0
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: tmp
valid:
from:
to:
x-trestle-template-type: cloud_security_baseline_checklist
x-trestle-template-type: b
x-trestle-template-version: 1.1.1
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: tmp
valid:
from: null
to: null
x-trestle-template-type: arch-design
x-trestle-template-type: a
x-trestle-template-version: 2.0.0
---
# System architecture
Expand Down
14 changes: 14 additions & 0 deletions tests/data/author/docs/a_folder_template/3.0.0/a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
authors: tmp
owner: tmp
valid:
from: null
to: null
x-trestle-template-type: a
x-trestle-template-version: 3.0.0
---
# System architecture

## Overview

## Security model
8 changes: 4 additions & 4 deletions tests/trestle/core/commands/author/docs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@ def test_multiple_dif_templates_recursive(
) -> None:
"""Test instance folder with multiple different template types inside a > 1 folder hierarchy."""
task_template_folder = tmp_trestle_dir / '.trestle/author/test_task/'
test_template_folder = testdata_dir / 'author/docs/arch-design_template'
test_instances_folder = testdata_dir / 'author/docs/arch-design'
test_template_folder = testdata_dir / 'author/docs/a_folder_template'
test_instances_folder = testdata_dir / 'author/docs/a_folder'
task_instance_folder = tmp_trestle_dir / 'test_task/'

shutil.copytree(test_template_folder, task_template_folder)
Expand All @@ -740,7 +740,7 @@ def test_multiple_dif_templates_recursive(
execute_command_and_assert(command_validate, 0, monkeypatch)

# Remove template type from instance and test to fail
task_markdown = task_instance_folder / 'ssad/mock/arch-design_v1.md'
task_markdown = task_instance_folder / 'folder_level_1/folder_level_2-1/a_v1.md'
md_api = MarkdownAPI()
header, tree = md_api.processor.process_markdown(task_markdown)
del header['x-trestle-template-type']
Expand All @@ -749,7 +749,7 @@ def test_multiple_dif_templates_recursive(

execute_command_and_assert(command_validate, 1, monkeypatch)
# set template type to arch-design again
header['x-trestle-template-type'] = 'arch-design'
header['x-trestle-template-type'] = 'a'

# Modify template headeing from instance and test to fail
a_node = tree.get_node_for_key('# System architecture', True)
Expand Down

0 comments on commit dbf443a

Please sign in to comment.