Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use deepcopy to avoid modifying responses
Responses and parameters can be stored as dictionary/list properties on View subclasses, or on HTTP operation methods. The LabThings apispec plugin includes these dictionaries in the spec, and the Marshmallow plugin then modifies the spec to reference schemas. In unit testing, we build the API description multiple times per run of Python, which means that the second time it's built, the dictionaries have been modified and contain only {"$ref": "#/components/schema/name"} instead of a Schema object. This commit uses deepcopy so that the descriptions on the classes/methods are not modified, and unit testing works again.
- Loading branch information