tests: Wrote tests for previously not-covered code.

Signed-off-by: Joe MacMahon <joe.macmahon@cern.ch>