Make installable by pip in editable mode

This commit is contained in:
Sebastian Lenzlinger
2024-06-27 17:50:21 +02:00
parent f024d6dec6
commit a29ffe92a6
4 changed files with 63 additions and 30 deletions

View File

@@ -0,0 +1,18 @@
# 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