mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-30 19:14:43 +00:00
Test obfuscated IPs only on Linux.
This commit is contained in:
parent
b249150d9a
commit
498e5cc786
2 changed files with 12 additions and 2 deletions
|
|
@ -17,6 +17,7 @@
|
|||
import signal
|
||||
import subprocess
|
||||
import os
|
||||
import sys
|
||||
import socket
|
||||
from nose import SkipTest
|
||||
from contextlib import contextmanager
|
||||
|
|
@ -103,6 +104,14 @@ def has_posix ():
|
|||
need_posix = _need_func(has_posix, "POSIX system")
|
||||
|
||||
|
||||
@memoized
|
||||
def has_linux ():
|
||||
"""Test if this is a Linux system."""
|
||||
return sys.platform.startswith("linux")
|
||||
|
||||
need_linux = _need_func(has_linux, "Linux system")
|
||||
|
||||
|
||||
@memoized
|
||||
def has_clamav ():
|
||||
"""Test if ClamAV daemon is installed and running."""
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test network functions.
|
|||
"""
|
||||
|
||||
import unittest
|
||||
from tests import need_posix, need_network
|
||||
from tests import need_posix, need_network, need_linux
|
||||
import linkcheck.network
|
||||
from linkcheck.network import iputil
|
||||
|
||||
|
|
@ -37,10 +37,11 @@ class TestNetwork (unittest.TestCase):
|
|||
ifc.getInterfaceList()
|
||||
|
||||
@need_network
|
||||
@need_posix
|
||||
@need_linux
|
||||
def test_iputils (self):
|
||||
host = "www.golem.de"
|
||||
ips = iputil.resolve_host(host)
|
||||
self.assertTrue(len(ips) > 0)
|
||||
obfuscated = iputil.obfuscate_ip(ips.pop())
|
||||
self.assertTrue(iputil.is_obfuscated_ip(obfuscated))
|
||||
hosts = iputil.lookup_ips([obfuscated])
|
||||
|
|
|
|||
Loading…
Reference in a new issue