Exemplo n.º 1
0
 def test_first_input(self):
     include_ports = [[80, 80], [22, 23], [8000, 9000]]
     exclude_ports = [8080, 8080]
     result = ape.apply_port_exclusions(include_ports, exclude_ports)
     self.assertEqual([[22, 23], [80, 80], [8000, 8079], [8081, 9000]], result)
Exemplo n.º 2
0
 def test_high_edge_case(self):
     include_ports = [[1, 1000]]
     exclude_ports = [1000, 1000]
     result = ape.apply_port_exclusions(include_ports, exclude_ports)
     self.assertEqual([[1, 999]], result)
Exemplo n.º 3
0
 def test_fifth_input(self):
     include_ports = []
     exclude_ports = [8080, 8080]
     result = ape.apply_port_exclusions(include_ports, exclude_ports)
     self.assertEqual([], result)
Exemplo n.º 4
0
 def test_fourth_input(self):
     include_ports = [[1, 1], [3, 65535], [2, 2]]
     exclude_ports = [500, 2500]
     result = ape.apply_port_exclusions(include_ports, exclude_ports)
     self.assertEqual([[1, 499], [2501, 65535]], result)
Exemplo n.º 5
0
 def test_third_input(self):
     include_ports = [[1,65535]]
     exclude_ports = [1000,2000]
     result = ape.apply_port_exclusions(include_ports, exclude_ports)
     self.assertEqual([[1, 999], [2001, 65535]], result)
Exemplo n.º 6
0
 def test_second_input(self):
     include_ports = [[8000, 9000], [80, 80], [22, 23]]
     exclude_ports = [1024, 1024]
     result = ape.apply_port_exclusions(include_ports, exclude_ports)
     self.assertEqual([[22, 23], [80, 80], [8000, 9000]], result)