-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for listener_port validation
certain combinations of listener_port and peers_from_control_nodes are invalid at the serializer level. namely, if peers_from_control_nodes is True, a listener_port must be set. Further, payload may not include one of these fields at all. Validation needs to handle this case as well by checking the value on the existing canonical address. The parametrized unit test was createdy from itertools product of the following: initial_port [None, 27199] payload_port [None, 27199, 27200, 'missing'] initial_peers_from [False, True] payload_peers_from [False, True, 'missing'] where initial_port is the starting listener_port and initial_peers_from is the starting peers_from_control_nodes value An instance is first patched with those initial values. Then a 2nd patch uses the payload_* values. The test then asserts HTTP codes and in the case of 400, that the validation error matches the expected error message. Signed-off-by: Seth Foster <[email protected]>
- Loading branch information
1 parent
b8e39bb
commit d8bf56c
Showing
2 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters