WIP - move doctest into unit test