Exemplo n.º 1
0
 def test_output_result_called_multiple_times(self):
     out = StringIO.StringIO()
     output_result(out, [5, 10], 20)
     output_result(out, [3, 7], 17)
     out.seek(0)
     self.assertEqual(out.read().strip(), '5 10 20\n3 7 17')
Exemplo n.º 2
0
 def test_output_result_throws_if_not_given_filelike_obj(self):
     self.assertRaises(AssertionError,
                       lambda: output_result(None, [5, 10], 20))
Exemplo n.º 3
0
 def test_output_result(self):
     out = StringIO.StringIO()
     output_result(out, [5, 10], 20)
     out.seek(0)
     self.assertEqual(out.read().strip(), '5 10 20')
 def test_output_result_called_multiple_times(self):
     out = StringIO.StringIO()
     output_result(out, [5, 10], 20)
     output_result(out, [3, 7], 17)
     out.seek(0)
     self.assertEqual(out.read().strip(), "5 10 20\n3 7 17")
 def test_output_result_throws_if_not_given_filelike_obj(self):
     self.assertRaises(AssertionError, lambda: output_result(None, [5, 10], 20))
 def test_output_result(self):
     out = StringIO.StringIO()
     output_result(out, [5, 10], 20)
     out.seek(0)
     self.assertEqual(out.read().strip(), "5 10 20")