Improved testing by moving doctest into two unittests