summaryrefslogtreecommitdiff
path: root/tests/unit/test_base.py
Commit message (Collapse)AuthorAgeFilesLines
* chore: add `pprint()` and `pformat()` methods to RESTObjectJohn L. Villalovos2022-01-081-0/+30
| | | | | This is useful in debugging and testing. As can easily print out the values from an instance in a more human-readable form.
* chore: attempt to be more informative for missing attributesjlvillal/attribute_helpJohn L. Villalovos2021-11-301-0/+24
| | | | | | | | | | | | | | | | A commonly reported issue from users on Gitter is that they get an AttributeError for an attribute that should be present. This is often caused due to the fact that they used the `list()` method to retrieve the object and objects retrieved this way often only have a subset of the full data. Add more details in the AttributeError message that explains the situation to users. This will hopefully allow them to resolve the issue. Update the FAQ in the docs to add a section discussing the issue. Closes #1138
* refactor: use new-style formatting for named placeholdersNejc Habjan2021-11-081-1/+1
|
* chore: convert to using type-annotations for managersJohn L. Villalovos2021-09-081-1/+1
| | | | | | | | | | | | | Convert our manager usage to be done via type annotations. Now to define a manager to be used in a RESTObject subclass can simply do: class ExampleClass(CRUDMixin, RESTObject): my_manager: MyManager Any type-annotation that annotates it to be of type *Manager (with the exception of RESTManager) will cause the manager to be created on the object.
* fix: catch invalid type used to initialize RESTObjectJohn L. Villalovos2021-06-101-0/+5
| | | | | | | | Sometimes we have errors where we don't get a dictionary passed to RESTObject.__init__() method. This breaks things but in confusing ways. Check in the __init__() method and raise an exception if it occurs.
* chore: move 'gitlab/tests/' dir to 'tests/unit/'John L. Villalovos2021-05-261-0/+174
Move the 'gitlab/tests/' directory to 'tests/unit/' so we have all the tests located under the 'tests/' directory.