#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     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.
#

import logging

from apache.aurora.client.cli.client import AuroraLogConfigurationPlugin


def test_log_plugin_enabled():
  plugin = AuroraLogConfigurationPlugin()

  plugin.before_dispatch(["aurora", "version", "--verbose"])

  assert logging.getLogger().getEffectiveLevel() == logging.DEBUG
  assert logging.getLogger('requests_kerberos').getEffectiveLevel() == logging.DEBUG


def test_log_plugin_disabled():
  plugin = AuroraLogConfigurationPlugin()

  plugin.before_dispatch(["aurora", "version"])

  assert logging.getLogger().getEffectiveLevel() == logging.INFO
  assert logging.getLogger('requests_kerberos').getEffectiveLevel() == logging.CRITICAL
