19 lines
564 B
Python
19 lines
564 B
Python
# test_main.py
|
|
import pytest
|
|
from click.testing import CliRunner
|
|
from iottb.main import cli # Adjust this import according to your project's structure
|
|
|
|
|
|
@pytest.fixture
|
|
def runner():
|
|
"""Fixture to return a Click CliRunner instance."""
|
|
return CliRunner()
|
|
|
|
|
|
def test_debug_option(runner):
|
|
"""Test if the debug mode sets the appropriate flag in the context."""
|
|
result = runner.invoke(cli, ['--debug'])
|
|
assert result.exit_code == 0
|
|
# If debug mode affects logging or other behavior, validate those:
|
|
assert 'DEBUG mode on' in result.output
|