Commit f1fa53e8 authored by Matias Guijarro's avatar Matias Guijarro
Browse files

test for issue #2845

parent 087aec83
......@@ -556,6 +556,23 @@ def dummy_tango_server(ports, beacon):
yield device_fqdn, dev_proxy
@pytest.fixture
def dummy_tango_server2(ports, beacon):
device_name = "id00/tango/dummy2"
device_fqdn = "tango://localhost:{}/{}".format(ports.tango_port, device_name)
with start_tango_server(
sys.executable,
"-u",
os.path.join(os.path.dirname(__file__), "dummy_tg_server.py"),
"dummy2",
device_fqdn=device_fqdn,
state=DevState.CLOSE,
) as dev_proxy:
yield device_fqdn, dev_proxy
@pytest.fixture
def wago_tango_server(ports, default_session, wago_emulator):
device_name = "1/1/wagodummy"
......
......@@ -5,7 +5,7 @@
# Copyright (c) 2015-2020 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
from bliss.config.conductor import client
from bliss.common.tango import Database
......@@ -201,3 +201,29 @@ def test_tangodb_setters(beacon, dummy_tango_server):
# db.delete_class_property(class_name, "dummy_cls_property1")
# result = db.get_class_property(class_name, "dummy_cls_property1")
# assert not result["dummy_cls_property1"]
def test_issue2845(beacon, beacon_directory, dummy_tango_server2):
device_fqdn, dev_proxy = dummy_tango_server2
db = Database()
# Dummy device info
domain = "id00"
family = "tango"
name = "dummy2"
obj_name = f"{domain}/{family}/{name}"
assert not db.get_device_property(obj_name, "dummy_property1")["dummy_property1"]
test_file_contents = client.get_text_file("tango/dummy.yml")
assert test_file_contents.endswith(
"tango_name: id00/tango/dummy2\n properties:\n personal_name: dummy2\n server: dummy_tg_server\n"
)
db.put_device_property(obj_name, {"dummy_property1": "test"})
result = db.get_device_property(obj_name, "dummy_property1")
assert list(result["dummy_property1"]) == ["test"]
test_file_contents = client.get_text_file("tango/dummy.yml")
assert test_file_contents.endswith(
"tango_name: id00/tango/dummy2\n properties:\n dummy_property1: test\n personal_name: dummy2\n server: dummy_tg_server\n"
)
......@@ -13,3 +13,10 @@
alias: dummy_alias
personal_name: dummy
server: dummy_tg_server
-
device:
- class: Dummy
tango_name: id00/tango/dummy2
properties:
personal_name: dummy2
server: dummy_tg_server
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment