def test_non_existing(tmpdir): with pytest.raises(FileNotFoundError): test_folder = str(tmpdir.join('non_existing')) folder_time(test_folder)
def check_time(folder, test_time, result_time): os.system('touch -t {time:%Y%m%d%H%M.%S} {file}'.format(time=test_time, file=folder)) assert result_time == folder_time(folder)