コード例 #1
0
    def test_single_writer(self):

        class W:
            pass

        w = W()
        self.assertEqual(w, output_writer.compose_writers([w]))
コード例 #2
0
    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)
コード例 #3
0
 def test_writer_is_none(self):
     self.assertEqual(None, output_writer.compose_writers([None]))
コード例 #4
0
 def test_empty(self):
     self.assertEqual(None, output_writer.compose_writers([]))