def test_extract_pipelineparam_with_types(self): """Test _extract_pipelineparams. """ p1 = PipelineParam( name='param1', op_name='op1', param_type={'customized_type_a': { 'property_a': 'value_a' }}) p2 = PipelineParam(name='param2', param_type='customized_type_b') p3 = PipelineParam( name='param3', value='value3', param_type={'customized_type_c': { 'property_c': 'value_c' }}) stuff_chars = ' between ' payload = str(p1) + stuff_chars + str(p2) + stuff_chars + str(p3) params = _extract_pipelineparams(payload) self.assertListEqual([p1, p2, p3], params) # Expecting the _extract_pipelineparam to dedup the pipelineparams among all the payloads. payload = [ str(p1) + stuff_chars + str(p2), str(p2) + stuff_chars + str(p3) ] params = _extract_pipelineparams(payload) self.assertListEqual([p1, p2, p3], params)
def test_extract_pipelineparam(self): """Test _extract_pipeleineparam.""" p1 = PipelineParam(name='param1', op_name='op1') p2 = PipelineParam(name='param2') p3 = PipelineParam(name='param3', value='value3') stuff_chars = ' between ' payload = str(p1) + stuff_chars + str(p2) + stuff_chars + str(p3) params = _extract_pipelineparams(payload) self.assertListEqual([p1, p2, p3], params) payload = [str(p1) + stuff_chars + str(p2), str(p2) + stuff_chars + str(p3)] params = _extract_pipelineparams(payload) self.assertListEqual([p1, p2, p3], params)