File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
sdks/python/apache_beam/yaml Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1099,6 +1099,33 @@ def test_expand_pipeline_with_incorrect_pipelines_key_fails(self):
10991099 with self .assertRaises (KeyError ):
11001100 expand_pipeline (p , spec , validate_schema = None )
11011101
1102+ def test_expand_pipeline_with_valid_schema (self ):
1103+ spec = '''
1104+ pipeline:
1105+ type: chain
1106+ transforms:
1107+ - type: Create
1108+ config:
1109+ elements: [1,2,3]
1110+ - type: LogForTesting
1111+ '''
1112+ with new_pipeline () as p :
1113+ expand_pipeline (p , spec , validate_schema = 'generic' )
1114+
1115+ def test_expand_pipeline_with_invalid_schema (self ):
1116+ spec = '''
1117+ pipeline:
1118+ type: chain
1119+ transforms:
1120+ - name: Create
1121+ config:
1122+ elements: [1,2,3]
1123+ - type: LogForTesting
1124+ '''
1125+ with new_pipeline () as p :
1126+ with self .assertRaises (jsonschema .ValidationError ):
1127+ expand_pipeline (p , spec , validate_schema = 'generic' )
1128+
11021129
11031130if __name__ == '__main__' :
11041131 logging .getLogger ().setLevel (logging .INFO )
You can’t perform that action at this time.
0 commit comments