예제 #1
0
파일: test_utils.py 프로젝트: cvcrckt/ona
    def test_partial(self):
        site_value = '10.0.0.0/8\n172.16.0.0/12\n192.168.100.0/16'
        actual = validate_pna_networks(site_value)
        expected = '10.0.0.0/8 172.16.0.0/12 192.168.0.0/16'
        self.assertEqual(actual, expected)

        site_value = '10.0.0.0;8\n172.16.0.0/12\n192.168.100.0/16'
        actual = validate_pna_networks(site_value)
        expected = '172.16.0.0/12 192.168.0.0/16'
        self.assertEqual(actual, expected)

        site_value = '10.0.0.0/8\n2001:db8::ff00:42:8329/24'
        actual = validate_pna_networks(site_value)
        expected = '10.0.0.0/8'
        self.assertEqual(actual, expected)

        site_value = '10.0.0.0/8\n172.16.0.0.0/12'
        actual = validate_pna_networks(site_value)
        expected = '10.0.0.0/8'
        self.assertEqual(actual, expected)

        site_value = '10.0.0.0/8\n172.16.256.0/12'
        actual = validate_pna_networks(site_value)
        expected = '10.0.0.0/8'
        self.assertEqual(actual, expected)
예제 #2
0
파일: test_utils.py 프로젝트: obsrvbl/ona
    def test_partial(self):
        site_value = '10.0.0.0/8\n172.16.0.0/12\n192.168.100.0/16'
        actual = validate_pna_networks(site_value)
        expected = '10.0.0.0/8 172.16.0.0/12 192.168.0.0/16'
        self.assertEqual(actual, expected)

        site_value = '10.0.0.0;8\n172.16.0.0/12\n192.168.100.0/16'
        actual = validate_pna_networks(site_value)
        expected = '172.16.0.0/12 192.168.0.0/16'
        self.assertEqual(actual, expected)

        site_value = '10.0.0.0/8\n2001:db8::ff00:42:8329/24'
        actual = validate_pna_networks(site_value)
        expected = '10.0.0.0/8'
        self.assertEqual(actual, expected)

        site_value = '10.0.0.0/8\n172.16.0.0.0/12'
        actual = validate_pna_networks(site_value)
        expected = '10.0.0.0/8'
        self.assertEqual(actual, expected)

        site_value = '10.0.0.0/8\n172.16.256.0/12'
        actual = validate_pna_networks(site_value)
        expected = '10.0.0.0/8'
        self.assertEqual(actual, expected)
예제 #3
0
파일: test_utils.py 프로젝트: cvcrckt/ona
    def test_none(self):
        site_value = '10.0.0.0;8'
        actual = validate_pna_networks(site_value)
        self.assertEqual(actual, '')

        site_value = 'adduser something evil'
        actual = validate_pna_networks(site_value)
        self.assertEqual(actual, '')

        site_value = None
        actual = validate_pna_networks(site_value)
        self.assertEqual(actual, '')
예제 #4
0
파일: test_utils.py 프로젝트: obsrvbl/ona
    def test_none(self):
        site_value = '10.0.0.0;8'
        actual = validate_pna_networks(site_value)
        self.assertEqual(actual, '')

        site_value = 'adduser something evil'
        actual = validate_pna_networks(site_value)
        self.assertEqual(actual, '')

        site_value = None
        actual = validate_pna_networks(site_value)
        self.assertEqual(actual, '')
예제 #5
0
파일: test_utils.py 프로젝트: cvcrckt/ona
 def test_valid(self):
     site_value = '10.0.0.0/8\n172.16.0.0/12\n192.168.0.0/16'
     actual = validate_pna_networks(site_value)
     expected = '10.0.0.0/8 172.16.0.0/12 192.168.0.0/16'
     self.assertEqual(actual, expected)
예제 #6
0
파일: test_utils.py 프로젝트: obsrvbl/ona
 def test_valid(self):
     site_value = '10.0.0.0/8\n172.16.0.0/12\n192.168.0.0/16'
     actual = validate_pna_networks(site_value)
     expected = '10.0.0.0/8 172.16.0.0/12 192.168.0.0/16'
     self.assertEqual(actual, expected)