# Path: dyndnsc/detector/base.py
# LOG = logging.getLogger(__name__)
# class IPDetector(Subject, DynamicCliMixin):
#     def __init__(self, *args, **kwargs):
#     def can_detect_offline(self):
#     def af(self):
#     def get_old_value(self):
#     def set_old_value(self, value):
#     def get_current_value(self, default=None):
#     def set_current_value(self, value):
#     def has_changed(self):
#     def configuration_key_prefix():


import unittest
    import socket
        import dyndnsc.detector.builtin
        import dyndnsc.detector.manager
        import dyndnsc.detector.dns as ns
        import dyndnsc.detector.base
        import dyndnsc.detector.dns as ns
        import dyndnsc.detector.command
        import dyndnsc.detector.rand
        import dyndnsc.detector.rand
from dyndnsc.detector.base import AF_INET, AF_INET6, AF_UNSPEC
        from dyndnsc.detector import socket_ip
        from dyndnsc.detector import webcheck
        from dyndnsc.detector import webcheck
        from dyndnsc.detector import webcheck
        from dyndnsc.detector import webcheck
        from dyndnsc.detector import null
        self.assertEqual("127.0.0.1", webcheck._parser_freedns_afraid("Detected IP : 127.0.0.1"))

        self.assertEqual(None, webcheck._parser_jsonip(""))
        self.assertEqual("127.0.0.1", webcheck._parser_jsonip(
            r'{"ip":"127.0.0.1","about":"/about","Pro!":"http://getjsonip.com"}'))

    def test_webcheck(self):
        """Run tests for IPDetectorWebCheck."""
        self.assertEqual("webcheck4", webcheck.IPDetectorWebCheck.configuration_key)
        detector = webcheck.IPDetectorWebCheck()
        self.assertFalse(detector.can_detect_offline())
        self.assertEqual(AF_INET, detector.af())
        self.assertEqual(None, detector.get_current_value())
        value = detector.detect()
        self.assertTrue(isinstance(value, (type(None), str)))

    def test_webcheck6(self):
        """Run tests for IPDetectorWebCheck6."""
        self.assertEqual("webcheck6", webcheck.IPDetectorWebCheck6.configuration_key)
        detector = webcheck.IPDetectorWebCheck6()
        self.assertFalse(detector.can_detect_offline())
        self.assertEqual(AF_INET6, detector.af())
        self.assertEqual(None, detector.get_current_value())
        self.assertTrue(isinstance(detector.detect(), (type(None), str)))

    def test_webcheck46(self):
        """Run tests for IPDetectorWebCheck46."""
        self.assertEqual("webcheck46", webcheck.IPDetectorWebCheck46.configuration_key)
        detector = webcheck.IPDetectorWebCheck46()
        self.assertFalse(detector.can_detect_offline())

# Path: dyndnsc/detector/base.py
# LOG = logging.getLogger(__name__)
# class IPDetector(Subject, DynamicCliMixin):
#     def __init__(self, *args, **kwargs):
#     def can_detect_offline(self):
#     def af(self):
#     def get_old_value(self):
#     def set_old_value(self, value):
#     def get_current_value(self, default=None):
#     def set_current_value(self, value):
#     def has_changed(self):
#     def configuration_key_prefix():


# Path: dyndnsc/tests/detector/test_all.py
import unittest
    import socket
        import dyndnsc.detector.builtin
        import dyndnsc.detector.manager
        import dyndnsc.detector.dns as ns
        import dyndnsc.detector.base
        import dyndnsc.detector.dns as ns
        import dyndnsc.detector.command
        import dyndnsc.detector.rand
        import dyndnsc.detector.rand
from dyndnsc.detector.base import AF_INET, AF_INET6, AF_UNSPEC
        from dyndnsc.detector import socket_ip
        from dyndnsc.detector import webcheck
        from dyndnsc.detector import webcheck
        from dyndnsc.detector import webcheck
        from dyndnsc.detector import webcheck
        from dyndnsc.detector import null

        self.assertEqual("127.0.0.1", webcheck._parser_freedns_afraid("Detected IP : 127.0.0.1"))

        self.assertEqual(None, webcheck._parser_jsonip(""))
        self.assertEqual("127.0.0.1", webcheck._parser_jsonip(
            r'{"ip":"127.0.0.1","about":"/about","Pro!":"http://getjsonip.com"}'))

    def test_webcheck(self):
        """Run tests for IPDetectorWebCheck."""
        self.assertEqual("webcheck4", webcheck.IPDetectorWebCheck.configuration_key)
        detector = webcheck.IPDetectorWebCheck()
        self.assertFalse(detector.can_detect_offline())
        self.assertEqual(AF_INET, detector.af())
        self.assertEqual(None, detector.get_current_value())
        value = detector.detect()
        self.assertTrue(isinstance(value, (type(None), str)))

    def test_webcheck6(self):
        """Run tests for IPDetectorWebCheck6."""
        self.assertEqual("webcheck6", webcheck.IPDetectorWebCheck6.configuration_key)
        detector = webcheck.IPDetectorWebCheck6()
        self.assertFalse(detector.can_detect_offline())
        self.assertEqual(AF_INET6, detector.af())
        self.assertEqual(None, detector.get_current_value())
        self.assertTrue(isinstance(detector.detect(), (type(None), str)))

    def test_webcheck46(self):
        """Run tests for IPDetectorWebCheck46."""
        self.assertEqual("webcheck46", webcheck.IPDetectorWebCheck46.configuration_key)
        detector = webcheck.IPDetectorWebCheck46()
        self.assertFalse(detector.can_detect_offline())

        self.assertEqual(AF_UNSPEC, detector.af())