Skip to content

Commit 481d27d

Browse files
committed
Add final exand pipeline ut
1 parent 6bedec3 commit 481d27d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

sdks/python/apache_beam/yaml/yaml_transform_unit_test.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff 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

11031130
if __name__ == '__main__':
11041131
logging.getLogger().setLevel(logging.INFO)

0 commit comments

Comments
 (0)