From 9a690f42dc8199adbefd26c0e0cd9ddc6cdb79e9 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Wed, 2 Oct 2024 22:36:20 +0200 Subject: [PATCH] Fix port and allow silence float could be int --- test/test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test.py b/test/test.py index 407ce60..c074f9c 100644 --- a/test/test.py +++ b/test/test.py @@ -2,10 +2,12 @@ import pytest import warnings from nucon import Nucon, NuconConfig, PumpStatus, PumpDryStatus, PumpOverloadStatus, BreakerStatus +WARN_FLOAT_COULD_BE_INT = False + @pytest.fixture(scope="module") def nucon_setup(): Nucon.set_dummy_mode(False) # Assume the game is running - Nucon.set_base_url("http://localhost:8080/") + Nucon.set_base_url("http://localhost:8785/") yield Nucon.set_dummy_mode(True) @@ -14,7 +16,7 @@ def test_read_all_parameters(nucon_setup): assert len(all_params) == len(Nucon) for param, value in all_params.items(): assert isinstance(value, param.param_type), f"Parameter {param.name} has incorrect type. Expected {param.param_type}, got {type(value)}" - if param.param_type == float and value.is_integer(): + if param.param_type == float and value.is_integer() and WARN_FLOAT_COULD_BE_INT: warnings.warn(f"Parameter {param.name} is a float but has an integer value: {value}") def test_write_writable_parameters(nucon_setup):