File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 15
15
16
16
"""Ensure the expected behaviour of View."""
17
17
18
+ import pytest
18
19
19
20
from structurizr .model import Model
20
- from structurizr .view .view import View
21
+ from structurizr .view .view import View , ViewIO
21
22
22
23
23
24
class DerivedView (View ):
@@ -79,3 +80,22 @@ def test_adding_all_relationships():
79
80
assert len (view .relationship_views ) == 2
80
81
assert rel1 in [vr .relationship for vr in view .relationship_views ]
81
82
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