Exemplo n.º 1
0
func (*writerBasicsSuite) TestReplaceDefaultWriterWithNil(c *gc.C) {
	oldWriter, err := loggo.ReplaceDefaultWriter(nil)
	c.Assert(oldWriter, gc.IsNil)
	c.Assert(err, gc.ErrorMatches, "Writer cannot be nil")
}
Exemplo n.º 2
0
func (*writerBasicsSuite) TestReplaceDefaultWriterNoDefault(c *gc.C) {
	loggo.RemoveWriter("default")
	oldWriter, err := loggo.ReplaceDefaultWriter(&loggo.TestWriter{})
	c.Assert(oldWriter, gc.IsNil)
	c.Assert(err, gc.ErrorMatches, `there is no "default" writer`)
}
Exemplo n.º 3
0
func (*writerBasicsSuite) TestReplaceDefaultWriter(c *gc.C) {
	oldWriter, err := loggo.ReplaceDefaultWriter(&loggo.TestWriter{})
	c.Assert(oldWriter, gc.NotNil)
	c.Assert(err, gc.IsNil)
}