def test_smoke_disk(self):
     builder = JobResultBuilder()
     builder.comments = 'it works'
     builder.execution_duration = 0.1
     builder.io_log_filename = 'log'
     builder.outcome = 'pass'
     builder.return_code = 0
     result = builder.get_result()
     self.assertEqual(result.comments, "it works")
     self.assertEqual(result.execution_duration, 0.1)
     self.assertEqual(result.io_log_filename, 'log')
     self.assertEqual(result.outcome, "pass")
     self.assertEqual(result.return_code, 0)
     # Sanity check: the builder we can re-create is identical
     builder2 = result.get_builder()
     self.assertEqual(builder, builder2)
 def test_smoke_memory(self):
     builder = JobResultBuilder()
     builder.comments = 'it works'
     builder.execution_duration = 0.1
     builder.io_log = [(0, 'stdout', b'ok\n')]
     builder.outcome = 'pass'
     builder.return_code = 0
     result = builder.get_result()
     self.assertEqual(result.comments, "it works")
     self.assertEqual(result.execution_duration, 0.1)
     self.assertEqual(
         result.io_log,
         (IOLogRecord(delay=0, stream_name='stdout', data=b'ok\n'), ))
     self.assertEqual(result.outcome, "pass")
     self.assertEqual(result.return_code, 0)
     # Sanity check: the builder we can re-create is identical
     builder2 = result.get_builder()
     self.assertEqual(builder, builder2)