Improve test for file / folder when file does not exist

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>