Exemplo n.º 1
0
 def test_check_remote_address_multiple_hosts(self):
     """
     Test checking if remote_address is in list of addresses taken
     from config file. Case when multiple host addresses was set.
     """
     address = '10.0.1.5'
     hosts = '192.168.1.0/24, 127.0.0.1, 10.0.1.0/29'
     self.assertTrue(check_remote_address(hosts, address))
Exemplo n.º 2
0
 def test_check_remote_address_not_in_hosts(self):
     """
     Test checking if remote_address is not in list of addresses
     taken from config file.
     """
     address = '192.168.2.100'
     hosts = '192.168.1.0/24'
     self.assertFalse(check_remote_address(hosts, address))
Exemplo n.º 3
0
 def test_check_remote_address_one_host(self):
     """
     Test checking if remote_address is in list of addresses taken
     from config file. Case when only one host was written in file.
     """
     address = '192.168.1.100'
     hosts = '192.168.1.0/24'
     self.assertTrue(check_remote_address(hosts, address))