Merge "Test stream no encoding bug"
This commit is contained in:
commit
8a1c91327e
tests/cmd
10
tests/cmd/fixtures/large-number-of-jobs-001.yaml
Normal file
10
tests/cmd/fixtures/large-number-of-jobs-001.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
- job-template:
|
||||||
|
name: '{name}-{a}-{b}-{c}'
|
||||||
|
|
||||||
|
- project:
|
||||||
|
name: project-name
|
||||||
|
a: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
b: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
c: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
jobs:
|
||||||
|
- '{name}-{a}-{b}-{c}'
|
@ -74,6 +74,22 @@ class TestTests(CmdTestsBase):
|
|||||||
'r', encoding='utf-8').read()
|
'r', encoding='utf-8').read()
|
||||||
self.assertEqual(console_out.getvalue().decode('utf-8'), xml_content)
|
self.assertEqual(console_out.getvalue().decode('utf-8'), xml_content)
|
||||||
|
|
||||||
|
def test_stream_input_output_no_encoding_exceed_recursion(self):
|
||||||
|
"""
|
||||||
|
Test that we don't have issues processing large number of jobs and
|
||||||
|
outputting the result if the encoding is not set.
|
||||||
|
"""
|
||||||
|
console_out = io.BytesIO()
|
||||||
|
|
||||||
|
input_file = os.path.join(self.fixtures_path,
|
||||||
|
'large-number-of-jobs-001.yaml')
|
||||||
|
with io.open(input_file, 'r') as f:
|
||||||
|
with mock.patch('sys.stdout', console_out):
|
||||||
|
console_out.encoding = None
|
||||||
|
with mock.patch('sys.stdin', f):
|
||||||
|
args = ['test']
|
||||||
|
self.execute_jenkins_jobs_with_args(args)
|
||||||
|
|
||||||
def test_stream_input_output_utf8_encoding(self):
|
def test_stream_input_output_utf8_encoding(self):
|
||||||
"""
|
"""
|
||||||
Run test mode simulating using pipes for input and output using
|
Run test mode simulating using pipes for input and output using
|
||||||
|
Loading…
x
Reference in New Issue
Block a user