コード例 #1
0
ファイル: test_windivert.py プロジェクト: iroiro123/pydivert
 def test_parse_ipv4_address(self):
     """
     Tests parsing of an ipv4 address into a network byte value
     """
     address = "192.168.1.1"
     driver = WinDivert()
     driver.register()
     result = driver.parse_ipv4_address(address)
     self.assertEqual(struct.unpack(">I", inet_pton(socket.AF_INET, address))[0], result)
コード例 #2
0
ファイル: test_windivert.py プロジェクト: rgom/pydivert
 def test_parse_ipv4_address(self):
     """
     Tests parsing of an ipv4 address into a network byte value
     """
     address = "192.168.1.1"
     driver = WinDivert()
     driver.register()
     result = driver.parse_ipv4_address(address)
     self.assertEqual(
         struct.unpack(">I", inet_pton(socket.AF_INET, address))[0], result)