def test_discovery_mode_dns(self):
        os.environ['DISCOVERY_MODE'] = 'dns'
        discovery.initialize()

        self.assertIsInstance(discovery.services, DnsRegistry)
    def test_discovery_mode_is_docker_when_docker_host_is_set(self):
        os.environ['DISCOVERY_MODE'] = ''
        os.environ['DOCKER_HOST'] = 'tcp://127.0.0.1:1234'
        discovery.initialize()

        self.assertIsInstance(discovery.services, DockerRegistry)
    def test_discovery_mode_defaults_to_dns(self):
        os.environ['DISCOVERY_MODE'] = ''
        os.environ['DOCKER_HOST'] = ''
        discovery.initialize()

        self.assertIsInstance(discovery.services, DnsRegistry)
    def test_discovery_mode_docker_compose(self):
        os.environ['DISCOVERY_MODE'] = 'env'
        discovery.initialize()

        self.assertIsInstance(discovery.services, EnvironmentRegistry)