File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
sdks/python/apache_beam/yaml Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1099,6 +1099,35 @@ 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+ @unittest .skipIf (jsonschema is None , "Yaml dependencies not installed" )
1103+ def test_expand_pipeline_with_valid_schema (self ):
1104+ spec = '''
1105+ pipeline:
1106+ type: chain
1107+ transforms:
1108+ - type: Create
1109+ config:
1110+ elements: [1,2,3]
1111+ - type: LogForTesting
1112+ '''
1113+ with new_pipeline () as p :
1114+ expand_pipeline (p , spec , validate_schema = 'generic' )
1115+
1116+ @unittest .skipIf (jsonschema is None , "Yaml dependencies not installed" )
1117+ def test_expand_pipeline_with_invalid_schema (self ):
1118+ spec = '''
1119+ pipeline:
1120+ type: chain
1121+ transforms:
1122+ - name: Create
1123+ config:
1124+ elements: [1,2,3]
1125+ - type: LogForTesting
1126+ '''
1127+ with new_pipeline () as p :
1128+ with self .assertRaises (jsonschema .ValidationError ):
1129+ expand_pipeline (p , spec , validate_schema = 'generic' )
1130+
11021131
11031132if __name__ == '__main__' :
11041133 logging .getLogger ().setLevel (logging .INFO )
You can’t perform that action at this time.
0 commit comments