Fix expected raised exception class in test