Example #1
0
    def test_noop_if_output_key_does_not_exist(self):
        original = {'foo': 'bar'}
        parsed = original.copy()

        handlers.decode_console_output(parsed)
        # Should be unchanged because the 'Output'
        # key is not in the output.
        self.assertEqual(parsed, original)
Example #2
0
 def test_get_console_output_cant_be_decoded(self):
     parsed = {'Output': 1}
     handlers.decode_console_output(parsed)
     self.assertEqual(parsed['Output'], 1)
Example #3
0
 def test_get_console_output_bad_unicode_errors(self):
     original = base64.b64encode(b'before\xffafter').decode('utf-8')
     parsed = {'Output': original}
     handlers.decode_console_output(parsed)
     self.assertEqual(parsed['Output'], u'before\ufffdafter')
Example #4
0
 def test_get_console_output(self):
     parsed = {'Output': base64.b64encode(b'foobar').decode('utf-8')}
     handlers.decode_console_output(parsed)
     self.assertEqual(parsed['Output'], 'foobar')