Write tests for lookup command

Follow up !171 (merged)