Unittest this function (also coverage)