fix test, change TypeError to ValueError