def testCsvMatchReplaceOk(self):
    pl = linter.PipelineLinter(
        '{"inputs": [{"type": "GcsInput", "object": "gs://b1/o1",'
        ' "sinks": ["gs:/b2/o2"]}],'
        ' "transforms": [{"type": "CsvMatchReplace",'
        ' "fieldDelimiter": ",", "columns": [{"wanted": true, '
        ' "type": "STRING", "name": "col1"}],'
        ' "sources": ["gs://bucket/foo.csv"],'
        ' "sinks": ["gs://bucket/results", "gs://bucket/badrows"]}]}')
    expect = {
        linter.PipelineLinter.CHECK_SYNTAX_VALID: {'pass': True},
        linter.PipelineLinter.CHECK_UNKNOWN_CONFIG_KEYS: {'pass': True},
        linter.PipelineLinter.CHECK_REQ_IO_STAGES: {'pass': True},
        'stages': {'transforms': [{
            linter.StageLinter.CHECK_TYPE_FMT % u'CsvMatchReplace':
            {'pass': True},
            linter.StageLinter.CHECK_TYPE_FMT % 'columns': {'pass': True},
            linter.StageLinter.CHECK_FIELD_EXISTS_FMT % 'sources':
            {'pass': True},
            linter.StageLinter.CHECK_FIELD_EXISTS_FMT % 'sinks':
            {'pass': True},
            'fieldDelimiter' % linter.StageLinter.CHECK_FIELD_EXISTS_FMT:
            {'pass': True},
            linter.StageLinter.CHECK_FIELD_EXISTS_FMT % 'columns':
            {'pass': True},}],
                   'inputs': [{
                       linter.StageLinter.CHECK_TYPE_FMT % u'GcsInput':
                       {'pass': True},
                       linter.StageLinter.CHECK_FIELD_EXISTS_FMT % 'sinks':
                       {'pass': True},
                       linter.StageLinter.CHECK_FIELD_EXISTS_FMT %
                       'object': {'pass': True},
                       linter.StageLinter.CHECK_FIELD_EXISTS_FMT %
                       ['object', 'objects']: {'pass': True}}]}}
    self.assertTrue(pl.results.valid)
    self.assertSameStructure(expect, pl.results.results)
dataset/ETHPy150Open GoogleCloudPlatform/Data-Pipeline/app/src/pipelines/linter_test.py/LintPipelineTest.testCsvMatchReplaceOk/swapped operands of `%`