Tests: Trivial fox use of 'is'. 73/17973/2
authorPaul Vinciguerra <pvinci@vinciconsulting.com>
Fri, 1 Mar 2019 18:35:55 +0000 (10:35 -0800)
committerDamjan Marion <dmarion@me.com>
Fri, 1 Mar 2019 20:50:25 +0000 (20:50 +0000)
'is' evaluates diffently depending on the value.

  >>> x=-10
  >>> x is -10
  False

  >>> x=10
  >>> x is 10
  True
  >>>

Change-Id: If72ec7c47e3e95180a4d08a773984253c80154d6
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
test/vpp_ip_route.py
test/vpp_neighbor.py

index 6e52481..bb421c0 100644 (file)
@@ -36,7 +36,7 @@ class MplsLspMode:
 
 
 def ip_to_dpo_proto(addr):
-    if addr.version is 6:
+    if addr.version == 6:
         return DpoProto.DPO_PROTO_IP6
     else:
         return DpoProto.DPO_PROTO_IP4
index 3099a25..95bcc0d 100644 (file)
@@ -17,7 +17,7 @@ def find_nbr(test, sw_if_index, nbr_addr, is_static=0, mac=None):
     ip_addr = ip_address(text_type(nbr_addr))
     e = VppEnum.vl_api_ip_neighbor_flags_t
     nbrs = test.vapi.ip_neighbor_dump(sw_if_index,
-                                      is_ipv6=(6 is ip_addr.version))
+                                      is_ipv6=(6 == ip_addr.version))
 
     for n in nbrs:
         if ip_addr == n.neighbor.ip_address and \