# Path: k8s/config.py
# def use_in_cluster_config(token_file="/var/run/secrets/kubernetes.io/serviceaccount/token",  # nosec
#                           ca_cert_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"):
#     def __init__(self, token_file, now_func=datetime.now):
#     def token(self, now_func=datetime.now):
#     def _refresh_token(self, now_func=datetime.now):
# class FileTokenSource(object):


import logging
import mock
import pytest
from k8s import config
#      http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.






@pytest.yield_fixture
def logger():
    """Set root logger to DEBUG, and add stream handler"""
    root_logger = logging.getLogger()
    old_level = root_logger.getEffectiveLevel()
    root_logger.setLevel(logging.DEBUG)
    handler = logging.StreamHandler()
    root_logger.addHandler(handler)
    yield root_logger
    root_logger.removeHandler(handler)
    root_logger.setLevel(old_level)


@pytest.fixture
def k8s_config(monkeypatch):
    """Configure k8s for test-runs"""
    monkeypatch.setattr(config, "api_server", "http://localhost:8080")

# Path: k8s/config.py
# def use_in_cluster_config(token_file="/var/run/secrets/kubernetes.io/serviceaccount/token",  # nosec
#                           ca_cert_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"):
#     def __init__(self, token_file, now_func=datetime.now):
#     def token(self, now_func=datetime.now):
#     def _refresh_token(self, now_func=datetime.now):
# class FileTokenSource(object):


# Path: tests/k8s/conftest.py
import logging
import mock
import pytest
from k8s import config

#      http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.






@pytest.yield_fixture
def logger():
    """Set root logger to DEBUG, and add stream handler"""
    root_logger = logging.getLogger()
    old_level = root_logger.getEffectiveLevel()
    root_logger.setLevel(logging.DEBUG)
    handler = logging.StreamHandler()
    root_logger.addHandler(handler)
    yield root_logger
    root_logger.removeHandler(handler)
    root_logger.setLevel(old_level)


@pytest.fixture
def k8s_config(monkeypatch):
    """Configure k8s for test-runs"""
    monkeypatch.setattr(config, "api_server", "http://localhost:8080")

    monkeypatch.setattr(config, "verify_ssl", False)