Skip to content

Commit

Permalink
Handle more v0 connection request fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sajith committed Sep 10, 2024
1 parent 1f333e3 commit 84771ad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sdx_datamodel/models/connection_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class ConnectionRequestV0Port(BaseModel):

id: str = Field(frozen=True)
name: str = Field(frozen=True)
short_name: str = Field(frozen=True, default=None)
label: str = Field(frozen=True, default=None)
label_range: str = Field(frozen=True, default=None)
node: Optional[str] = Field(frozen=True, default=None)
status: Optional[str] = Field(frozen=True, default=None)

Expand Down
16 changes: 16 additions & 0 deletions tests/test_connection_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,22 @@ def test_connection_request_v0_p2p(self):
request = ConnectionRequestV0.parse_file(TestData.CONNECTION_FILE_P2P)
self.assertIsInstance(request, ConnectionRequestV0)

self.assertIsNotNone(request.ingress_port.id)
self.assertIsNotNone(request.ingress_port.name)
self.assertIsNotNone(request.ingress_port.short_name)
self.assertIsNotNone(request.ingress_port.label)
self.assertIsNotNone(request.ingress_port.label_range)
self.assertIsNotNone(request.ingress_port.node)
self.assertIsNone(request.ingress_port.status)

self.assertIsNotNone(request.egress_port.id)
self.assertIsNotNone(request.egress_port.name)
self.assertIsNotNone(request.egress_port.short_name)
self.assertIsNotNone(request.egress_port.label)
self.assertIsNotNone(request.egress_port.label_range)
self.assertIsNotNone(request.egress_port.node)
self.assertIsNone(request.egress_port.status)


if __name__ == "__main__":
unittest.main()

0 comments on commit 84771ad

Please sign in to comment.