def testJunk(self):
    bad_strings = ((None, 'PreTemplate: expected string or buffer'),
                   ('', 'PreTemplate: No JSON object could be decoded'),
                   ('"', 'PreTemplate: end is out of bounds'),
                   ('"fish', 'PreTemplate: %s' %
                    self.getUnterminatedStringMessage('"fish')),
                   ('fish', 'PreTemplate: No JSON object could be decoded'))
    for (bad_string, reason) in bad_strings:
      logging.info('testing: %r', bad_string)
      pl = linter.PipelineLinter(bad_string)
      expect = {
          linter.PipelineLinter.CHECK_UNKNOWN_CONFIG_KEYS: {'pass': True},
          linter.PipelineLinter.CHECK_SYNTAX_VALID: {
              'pass': False,
              'reason': reason},
          linter.PipelineLinter.CHECK_REQ_IO_STAGES: {
              'pass': False,
              'reason': linter.PipelineLinter.MSG_MISSING_IO_STAGES}}
      self.assertFalse(pl.results.valid, 'Config:%r ' % bad_string)
      self.assertSameStructure(expect, pl.results.results,
                               'Config:%r' % bad_string)
dataset/ETHPy150Open GoogleCloudPlatform/Data-Pipeline/app/src/pipelines/linter_test.py/LintPipelineTest.testJunk/original