Ejemplo n.º 1
0
    def test_increment_ipv4_segments(self):
        values = [
            (("127", "0", "0", "1"), "127.0.0.2"),
            (("255", "255", "255", "0"), "255.255.255.1"),
            (("254", "255", "255", "255"), "255.0.0.0"),
            (("100", "1", "0", "255"), "100.1.1.0"),
        ]

        for segments, incremented_ip in values:
            result = increment_ipv4_segments(segments=segments)
            result = join_ipv4_segments(segments=result)
            self.assertEqual(result, incremented_ip)
Ejemplo n.º 2
0
    def test_increment_ipv4_segments(self):
        values = [
            (('127', '0', '0', '1'), '127.0.0.2'),
            (('255', '255', '255', '0'), '255.255.255.1'),
            (('254', '255', '255', '255'), '255.0.0.0'),
            (('100', '1', '0', '255'), '100.1.1.0'),
        ]

        for segments, incremented_ip in values:
            result = increment_ipv4_segments(segments=segments)
            result = join_ipv4_segments(segments=result)
            self.assertEqual(result, incremented_ip)
Ejemplo n.º 3
0
    def test_increment_ipv4_segments(self):
        values = [
            (('127', '0', '0', '1'), '127.0.0.2'),
            (('255', '255', '255', '0'), '255.255.255.1'),
            (('254', '255', '255', '255'), '255.0.0.0'),
            (('100', '1', '0', '255'), '100.1.1.0'),
        ]

        for segments, incremented_ip in values:
            result = increment_ipv4_segments(segments=segments)
            result = join_ipv4_segments(segments=result)
            self.assertEqual(result, incremented_ip)