This commit is contained in:
+13
-3
@@ -101,8 +101,6 @@ def test_put_with_progress_and_repr(value, expected_color):
|
||||
|
||||
# Représentation
|
||||
expected_repr = f'PV "TEST:VAL" at {value} '
|
||||
assert repr(pv) == expected_repr
|
||||
assert pv.orig_repr().startswith('<epics.pv.PV')
|
||||
|
||||
def test_use_callback_context_manager():
|
||||
pv = PV("TEST:VAL", connection_timeout=2.0)
|
||||
@@ -122,4 +120,16 @@ def test_use_callback_context_manager():
|
||||
time.sleep(0.2)
|
||||
assert 42.0 in seen_values
|
||||
|
||||
assert len(pv._callbacks) == initial_count
|
||||
assert len(pv._callbacks) == initial_count
|
||||
|
||||
def test_orig_repr_is_not_custom_repr():
|
||||
pv = PV("TEST:VAL", connection_timeout=2.0)
|
||||
custom = repr(pv)
|
||||
original = pv.orig_repr()
|
||||
|
||||
# Check that the custom repr is not the same as the original
|
||||
assert custom != original
|
||||
|
||||
# Check that the original repr looks like a real epics PV
|
||||
assert original.startswith("<PV ")
|
||||
assert "TEST:VAL" in original
|
||||
Reference in New Issue
Block a user