#1491 Write helper functions for unit tests to generate entries
Closed: fixed 5 years ago Opened 12 years ago by rcritten.

When writing XML-RPC unit test cases is in large part an exercise in copy-and-paste, particularly for functions that affect lots of different kinds of objects (like netgroups).

It would be handy to have some simple helpers like create_user(uid=foo) that generates a user entry for the given uid, verifies that is ok, and returns. This will also centralize changes so that if/when these objects get updated to return different values we don't have to make updates to multiple test cases.

This would make it significantly easier to generate more complex and larger tests and be much more readable. See the nesting case for a negative example of readability due to the sheer number of entries required.


Ondra shall look on this in a scope of his internship.

Alexander had the idea of instead using the json from the UI unit tests for both.

Releasing tickets from distant milestones.

Metadata Update from @rcritten:
- Issue assigned to someone
- Issue set to the milestone: Ticket Backlog

7 years ago

Metadata Update from @rcritten:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.

Metadata