From d43cd0fd620dc5be495358ff8a655b0b07b17d29 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Wed, 20 Dec 2017 10:07:31 -0200 Subject: [PATCH] isis-topo1: simplify dictionary key removal code Signed-off-by: Rafael Zalamena --- tests/topotests/isis-topo1/test_isis_topo1.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/topotests/isis-topo1/test_isis_topo1.py b/tests/topotests/isis-topo1/test_isis_topo1.py index c855644e39..544671da57 100644 --- a/tests/topotests/isis-topo1/test_isis_topo1.py +++ b/tests/topotests/isis-topo1/test_isis_topo1.py @@ -165,15 +165,8 @@ def test_isis_route_installation(): continue for nexthop in route['nexthops']: - try: - nexthop.pop('interfaceIndex') - except KeyError: - pass - - try: - nexthop.pop('interfaceName') - except KeyError: - pass + nexthop.pop('interfaceIndex', None) + nexthop.pop('interfaceName', None) assertmsg = "Router '{}' routes mismatch".format(rname) assert topotest.json_cmp(actual, expected) is None, assertmsg -- 2.39.5