Add unit test for the drain method.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>