#
#
from __future__ import annotations
import json
from unittest import mock
import pytest
import requests
from airflow.api_internal.internal_api_call import InternalApiConfig, internal_api_call
from airflow.serialization.serialized_objects import BaseSerialization
from tests.test_utils.config import conf_vars
@pytest.fixture(autouse=True)
def reset_init_api_config():
    InternalApiConfig._initialized = False
class TestInternalApiConfig:
    @conf_vars(
        {
            ("core", "database_access_isolation"): "false",
            ("core", "internal_api_url"): "http://localhost:8888",
        }
    )
    def test_get_use_internal_api_disabled(self):
        assert InternalApiConfig.get_use_internal_api() is False
    @conf_vars(
        {
            ("core", "database_access_isolation"): "true",
            ("core", "internal_api_url"): "http://localhost:8888",
        }
    )
    def test_get_use_internal_api_enabled(self):