'Run test mode simulating using pipes for input and output using
ascii encoding for output with include containing a character
that cannot be converted.'

def test_stream_output_ascii_encoding_invalid_char(self):

    console_out = io.BytesIO()
    console_out.encoding = 'ascii'
    input_file = os.path.join(self.fixtures_path, 'unicode001.yaml')
    with io.open(input_file, 'r', encoding='utf-8') as f:
        with mock.patch('sys.stdout', console_out):
            with mock.patch('sys.stdin', f):
                args = ['--conf', self.default_config_file, 'test']
                jenkins_jobs = entry.JenkinsJobs(args)
                e = self.assertRaises(UnicodeError, jenkins_jobs.execute)
    self.assertIn("'ascii'    codec    can't    encode    character", str(e))
