formatted tests and changed to AttributeError