Skip to content

Commit

Permalink
fix bugs unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
Josephine.Rutten committed Oct 28, 2024
1 parent 2d69f8b commit bdf62ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cnaas_nms/api/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def put(self, hostname):
errors.append("configtype is not a string")
else:
if InterfaceConfigType.has_name(configtype):
if intf.configtype != str(InterfaceConfigType[configtype]):
intf.configtype = str(InterfaceConfigType[configtype])
if intf.configtype != InterfaceConfigType[configtype]:
intf.configtype = InterfaceConfigType[configtype]
updated = True
data[if_name] = {"configtype": configtype}
else:
Expand Down
8 changes: 4 additions & 4 deletions src/cnaas_nms/db/settings_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class f_extroute_ospfv3(BaseModel):

class f_extroute_bgp_neighbor_v4(BaseModel):
peer_ipv4: str = ipv4_schema
peer_as: str = as_num_schema
peer_as: int = as_num_schema
route_map_in: str = vlan_name_schema
route_map_out: str = vlan_name_schema
description: str = "undefined"
Expand All @@ -242,7 +242,7 @@ class f_extroute_bgp_neighbor_v4(BaseModel):

class f_extroute_bgp_neighbor_v6(BaseModel):
peer_ipv6: str = ipv6_schema
peer_as: str = as_num_schema
peer_as: int = as_num_schema
route_map_in: str = vlan_name_schema
route_map_out: str = vlan_name_schema
description: str = "undefined"
Expand All @@ -259,7 +259,7 @@ class f_extroute_bgp_neighbor_v6(BaseModel):

class f_extroute_bgp_vrf(BaseModel):
name: str
local_as: str = as_num_schema
local_as: int = as_num_schema
neighbor_v4: List[f_extroute_bgp_neighbor_v4] = []
neighbor_v6: List[f_extroute_bgp_neighbor_v6] = []
cli_append_str: str = ""
Expand Down Expand Up @@ -326,7 +326,7 @@ class f_underlay(BaseModel):
infra_lo_net: str = ipv4_if_schema
infra_link_net: str = ipv4_if_schema
mgmt_lo_net: str = ipv4_if_schema
bgp_asn: Optional[str] = as_num_schema
bgp_asn: Optional[int] = as_num_schema


class f_user(BaseModel):
Expand Down
1 change: 1 addition & 0 deletions src/cnaas_nms/devicehandler/tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def setUp(self):
with open(os.path.join(data_dir, "testdata.yml"), "r") as f_testdata:
self.testdata = yaml.safe_load(f_testdata)

# maybe ar tge type of dict
def get_linknets(self, session, neighbors_data: Optional[dict] = None, hostname: str = "eosaccess"):
if not neighbors_data:
neighbors_data = self.testdata["lldp_data_redundant"]
Expand Down

0 comments on commit bdf62ec

Please sign in to comment.