Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

[EPD-369] Update endpoint and topic parsing tests to use string values for cong…#3

Merged
nisseknudsen merged 1 commit intomainfrom
nisse/EPD-369-fix-enums-to-values
Mar 28, 2025
Merged

[EPD-369] Update endpoint and topic parsing tests to use string values for cong…#3
nisseknudsen merged 1 commit intomainfrom
nisse/EPD-369-fix-enums-to-values

Conversation

@nisseknudsen
Copy link
Contributor

…estion control, priority, and reliability

@nisseknudsen nisseknudsen requested a review from Copilot March 28, 2025 21:11
@notion-workspace
Copy link

Zenoh Buffer Config

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the tests and associated enums to use descriptive string values for congestion control, priority, and reliability instead of numeric values. The changes ensure that the tests for endpoint and topic parsing validate string representations that match the new enum definitions.

  • Updated tests in parse_topics.py to supply string values for congestion control, priority, and reliability.
  • Updated tests in parse_endpoints.py to supply string values for congestion control and priority.
  • Modified enum definitions in make87/utils.py to subclass from str and use string literal values.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/unit/utils/parse_topics.py Updated JSON values to be string representations; tests now work with the updated enums.
tests/unit/utils/parse_endpoints.py Updated JSON values to be string representations for congestion control and priority.
make87/utils.py Updated enum definitions to subclass from str and use string literal values.
Comments suppressed due to low confidence (3)

tests/unit/utils/parse_topics.py:57

  • Consider adding an assertion to validate that topics.topics[0].congestion_control is correctly set to the expected enum value (e.g., CongestionControl.DROP) to improve test coverage.
valid_json = '{"topics": [{"topic_name": "test_topic", "topic_key": "test_key", "message_type": "test_type", "topic_type": "PUB", "congestion_control": "DROP"}]}'

tests/unit/utils/parse_endpoints.py:29

  • Consider adding an assertion to verify that endpoints[0].congestion_control is correctly set to CongestionControl.DROP after parsing.
valid_json = '{"endpoints": [{"endpoint_name": "test_endpoint", "endpoint_key": "test_key", "requester_message_type": "test_type", "provider_message_type": "test_type", "endpoint_type": "REQ", "congestion_control": "DROP"}]}'

tests/unit/utils/parse_endpoints.py:38

  • Consider adding an assertion to check that endpoints[0].priority equals Priority.REAL_TIME, ensuring that the string conversion is handled correctly.
valid_json = '{"endpoints": [{"endpoint_name": "test_endpoint", "endpoint_key": "test_key", "requester_message_type": "test_type", "provider_message_type": "test_type", "endpoint_type": "REQ", "priority": "REAL_TIME"}]}'

@nisseknudsen nisseknudsen merged commit a8235bd into main Mar 28, 2025
@nisseknudsen nisseknudsen deleted the nisse/EPD-369-fix-enums-to-values branch March 28, 2025 21:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant