Add a new BaseResource model that will be used by all API models.
Review Request #3785 — Created Jan. 21, 2013 and submitted — Latest diff uploaded
Add a new BaseResource model that will be used by all API models. The BaseResource model provides all the common functionality for dealing with requests and parsing results, ensuring a model is ready to use (has its data fetched) before we do anything with it, and being able to ensure it's created before using it. These models have a concept of a parent resource that they're under (for example, a diff being under a review draft). This change just introduces this model and a suite of unit tests for it. We'll move over to this in subsequent commits.
Wrote unit tests to cover all the various code paths, testing for success, failure, possible things that could be overridden, and so on. They all pass. This was developed along with a change to migrate DiffComment and use that, and that change worked. That'll be up once the other Comment classes have been converted.