aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_snat.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-01-04 12:58:53 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-01-11 23:26:16 +0000
commitda505f608e0919c45089dc80f9e3e16330a6551a (patch)
tree9ed1acf859ac883ba96e64b6f791047d1d6691b1 /test/test_snat.py
parenta48ad28256d0bc0de8a64f4b04f86fde39248d67 (diff)
make test: improve documentation and PEP8 compliance
Change-Id: Ib4f0353aab6112fcc3c3d8f0bcbed5bc4b567b9b Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/test_snat.py')
-rw-r--r--test/test_snat.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/test_snat.py b/test/test_snat.py
index ca2e52a7681..d23becf5ce9 100644
--- a/test/test_snat.py
+++ b/test/test_snat.py
@@ -130,13 +130,15 @@ class TestSNAT(VppTestCase):
if same_port:
self.assertEqual(packet[TCP].sport, self.tcp_port_in)
else:
- self.assertNotEqual(packet[TCP].sport, self.tcp_port_in)
+ self.assertNotEqual(
+ packet[TCP].sport, self.tcp_port_in)
self.tcp_port_out = packet[TCP].sport
elif packet.haslayer(UDP):
if same_port:
self.assertEqual(packet[UDP].sport, self.udp_port_in)
else:
- self.assertNotEqual(packet[UDP].sport, self.udp_port_in)
+ self.assertNotEqual(
+ packet[UDP].sport, self.udp_port_in)
self.udp_port_out = packet[UDP].sport
else:
if same_port:
@@ -215,8 +217,14 @@ class TestSNAT(VppTestCase):
addr_only = 0
l_ip = socket.inet_pton(socket.AF_INET, local_ip)
e_ip = socket.inet_pton(socket.AF_INET, external_ip)
- self.vapi.snat_add_static_mapping(l_ip, e_ip, local_port, external_port,
- addr_only, vrf_id, is_add)
+ self.vapi.snat_add_static_mapping(
+ l_ip,
+ e_ip,
+ local_port,
+ external_port,
+ addr_only,
+ vrf_id,
+ is_add)
def snat_add_address(self, ip, is_add=1):
"""
@@ -413,7 +421,9 @@ class TestSNAT(VppTestCase):
self.pg3.assert_nothing_captured()
def test_multiple_inside_interfaces(self):
- """SNAT multiple inside interfaces with non-overlapping address space"""
+ """
+ SNAT multiple inside interfaces with non-overlapping address space
+ """
self.snat_add_address(self.snat_addr)
self.vapi.snat_interface_add_del_feature(self.pg0.sw_if_index)