

def _test_populated_whitelist(self, whitelist_name):
    (net1, net2) = ('1.2.3.4/32', '4.3.2.1/255.255.0.0')
    cmd_line_flag = ('--%s' % (whitelist_name,))
    self.cmd_line.extend([cmd_line_flag, net1, cmd_line_flag, net2])
    self.config.parseOptions(self.cmd_line)
    self.assertEqual(len(self.config[whitelist_name]), 2)
    for net in [net1, net2]:
        self.assertTrue((ip_network(net, strict=False) in self.config[whitelist_name]))

dataset/ETHPy150Open jdswinbank/Comet/comet/service/test/test_broker.py DefaultOptionsTestCase._test_populated_whitelist/original