File tree Expand file tree Collapse file tree 3 files changed +43
-4
lines changed Expand file tree Collapse file tree 3 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 43
43
)
44
44
assert _DUPLICATE_WORKFLOW_VARIABLE_NAMES_WORKFLOW
45
45
46
+ _STEP_SPECIFICATION_VARIABLE_NAMES_WORKFLOW_FILE : str = os .path .join (
47
+ os .path .dirname (__file__ ),
48
+ "workflow-definitions" ,
49
+ "step-specification-variable-names.yaml" ,
50
+ )
51
+ with open (
52
+ _STEP_SPECIFICATION_VARIABLE_NAMES_WORKFLOW_FILE , "r" , encoding = "utf8"
53
+ ) as workflow_file :
54
+ _STEP_SPECIFICATION_VARIABLE_NAMES_WORKFLOW : Dict [str , Any ] = yaml .safe_load (
55
+ workflow_file
56
+ )
57
+ assert _STEP_SPECIFICATION_VARIABLE_NAMES_WORKFLOW
58
+
46
59
47
60
def test_validate_schema_for_minimal ():
48
61
# Arrange
@@ -110,6 +123,16 @@ def test_validate_schema_for_python_simple_molprops():
110
123
assert error is None
111
124
112
125
126
+ def test_validate_schema_for_step_specification_variable_names ():
127
+ # Arrange
128
+
129
+ # Act
130
+ error = decoder .validate_schema (_STEP_SPECIFICATION_VARIABLE_NAMES_WORKFLOW )
131
+
132
+ # Assert
133
+ assert error is None
134
+
135
+
113
136
def test_get_workflow_variables_for_smiple_python_molprops ():
114
137
# Arrange
115
138
Original file line number Diff line number Diff line change
1
+ ---
2
+ kind : DataManagerWorkflow
3
+ kind-version : " 2024.1"
4
+ name : step-variables
5
+ description : Test a lot of variables whose format is supported
6
+ steps :
7
+ - name : step-1
8
+ specification :
9
+ collection : a
10
+ job : b
11
+ version : ' 1.0.0'
12
+ variables :
13
+ _a : 1
14
+ A-1 : 2.0
15
+ a_14_ : A string
16
+ A-Long_boolean_variable_Name : true
Original file line number Diff line number Diff line change @@ -164,15 +164,15 @@ definitions:
164
164
165
165
# A step specification variable
166
166
# (there must be at least one if a variables block is defined).
167
- # Typical variable syntax - must start with a letter
168
- # and only contain letters, numbers, hyphen or underbar .
169
- # The value of the object is quite relaxed...
167
+ # Typical variable syntax based on Python's definition of a variable
168
+ # but with the inclusion of ' hyphen' within the variable .
169
+ # The value of the variable (the object itself) is quite relaxed...
170
170
# it simply needs to be a string, number (integer or float), or boolean.
171
171
step-specification-variable :
172
172
type : object
173
173
additionalProperties : false
174
174
patternProperties :
175
- ' ^[a-zA-Z ]{1}[a-zA-Z0-9-_ ]{0,79}$ ' :
175
+ ' ^[a-zA-Z_ ]{1}[a-zA-Z0-9_- ]{0,79}$ ' :
176
176
oneOf :
177
177
- type : string
178
178
- type : integer
You can’t perform that action at this time.
0 commit comments