def test_single_writer(self): class W: pass w = W() self.assertEqual(w, output_writer.compose_writers([w]))
def test_multiple_writers(self): class W: pass ws = [W(), W()] w = output_writer.compose_writers(ws) self.assertTrue(isinstance(w, output_writer.CompositeWriter)) self.assertEqual(list(w.writers), ws)
def test_writer_is_none(self): self.assertEqual(None, output_writer.compose_writers([None]))
def test_empty(self): self.assertEqual(None, output_writer.compose_writers([]))