File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1515
1616"""Ensure the expected behaviour of View."""
1717
18+ import pytest
1819
1920from structurizr .model import Model
20- from structurizr .view .view import View
21+ from structurizr .view .view import View , ViewIO
2122
2223
2324class DerivedView (View ):
@@ -79,3 +80,22 @@ def test_adding_all_relationships():
7980 assert len (view .relationship_views ) == 2
8081 assert rel1 in [vr .relationship for vr in view .relationship_views ]
8182 assert rel2 in [vr .relationship for vr in view .relationship_views ]
83+
84+
85+ @pytest .mark .xfail (strict = True )
86+ def test_missing_json_description_allowed ():
87+ """
88+ Ensure that missing descriptions in the JSON form are supported.
89+
90+ Raised as https://github.com/Midnighter/structurizr-python/issues/40, it is
91+ permitted through the Structurizr UI to create views with a blank description,
92+ which then gets ommitted from the workspace JSON, so this needs to be allowed by
93+ the Pydantic validation also.
94+ """
95+
96+ json = """
97+ {
98+ "key": "System1-SystemContext"
99+ }
100+ """
101+ ViewIO .parse_raw (json ) # Fails as description is missing
You can’t perform that action at this time.
0 commit comments