diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-03-28 09:53:44 -0700 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-03-29 16:02:27 +0000 |
commit | 3593a9174a8e9faddb8d4eb451d1b4632c1e0df1 (patch) | |
tree | 69e94c2f92662b09cef02a14167d1145a9ed575b /test/test_gbp.py | |
parent | 60f3e6547aa75a31fad1f78bea11c950cc30d63c (diff) |
tests: refactor vpp_object.py
Move __str__ to super for all subclasses of VppObject
Implement __repr__ in VppObject
Implement __hash__ and __eq__
Change-Id: Ibd4ea37b84b17f499ab86630fb5b9ed9c8b4b1c2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_gbp.py')
-rw-r--r-- | test/test_gbp.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/test/test_gbp.py b/test/test_gbp.py index 74eb424eb4f..c5f5192ea7e 100644 --- a/test/test_gbp.py +++ b/test/test_gbp.py @@ -131,9 +131,6 @@ class VppGbpEndpoint(VppObject): def remove_vpp_config(self): self._test.vapi.gbp_endpoint_del(self.handle) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-endpoint:[%d==%d:%s:%d]" % (self.handle, self.itf.sw_if_index, @@ -172,9 +169,6 @@ class VppGbpRecirc(VppObject): self.epg.sclass, self.is_ext) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-recirc:[%d]" % (self.recirc.sw_if_index) @@ -212,9 +206,6 @@ class VppGbpExtItf(VppObject): self.bd.bd_id, self.rd.rd_id) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-ext-itf:[%d]" % (self.itf.sw_if_index) @@ -256,9 +247,6 @@ class VppGbpSubnet(VppObject): self.prefix.encode(), self.type) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-subnet:[%d-%s]" % (self.rd_id, self.prefix) @@ -314,9 +302,6 @@ class VppGbpEndpointGroup(VppObject): def remove_vpp_config(self): self._test.vapi.gbp_endpoint_group_del(self.sclass) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-endpoint-group:[%d]" % (self.vnid) @@ -359,9 +344,6 @@ class VppGbpBridgeDomain(VppObject): def remove_vpp_config(self): self._test.vapi.gbp_bridge_domain_del(self.bd.bd_id) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-bridge-domain:[%d]" % (self.bd.bd_id) @@ -398,9 +380,6 @@ class VppGbpRouteDomain(VppObject): def remove_vpp_config(self): self._test.vapi.gbp_route_domain_del(self.rd_id) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-route-domain:[%d]" % (self.rd_id) @@ -483,9 +462,6 @@ class VppGbpContract(VppObject): [], self.allowed_ethertypes) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-contract:[%d:%s:%d]" % (self.sclass, self.dclass, @@ -525,9 +501,6 @@ class VppGbpVxlanTunnel(VppInterface): def remove_vpp_config(self): self._test.vapi.gbp_vxlan_tunnel_del(self.vni) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-vxlan:%d" % (self.sw_if_index) @@ -576,9 +549,6 @@ class VppGbpAcl(VppObject): def remove_vpp_config(self): self._test.vapi.acl_del(self.acl_index) - def __str__(self): - return self.object_id() - def object_id(self): return "gbp-acl:[%d]" % (self.acl_index) |