Skip to content

Commit

Permalink
add test_port_translation_func_empty_port_number
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianliebscher authored and EugeneTorap committed May 11, 2023
1 parent c4f9789 commit 25f1733
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/unit_tests/advanced_data_type/types_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,30 @@ def test_port_translation_func_invalid_port_number():
assert port.translate_type(port_request) == port_response


def test_port_translation_func_empty_port_number():
"""Test to see if the port_translation_func behaves as expected when no port
number is passed in"""
port_request: AdvancedDataTypeRequest = {
"advanced_data_type": "port",
"values": [""],
}
port_response: AdvancedDataTypeResponse = {
"values": [[""]],
"error_message": "",
"display_value": "",
"valid_filter_operators": [
FilterStringOperators.EQUALS,
FilterStringOperators.GREATER_THAN_OR_EQUAL,
FilterStringOperators.GREATER_THAN,
FilterStringOperators.IN,
FilterStringOperators.LESS_THAN,
FilterStringOperators.LESS_THAN_OR_EQUAL,
],
}

assert port.translate_type(port_request) == port_response


def test_cidr_translate_filter_func_equals():
"""Test to see if the cidr_translate_filter_func behaves as expected when the EQUALS
operator is used"""
Expand Down

0 comments on commit 25f1733

Please sign in to comment.