Commit 456ec959 authored by Wout De Nolf's avatar Wout De Nolf
Browse files

test: default session has no data policy

parent e8b82ce9
......@@ -819,20 +819,25 @@ class Session:
class DefaultSession(Session):
"""Session without config, setup scripts and data policy
"""
def __init__(self):
Session.__init__(self, "__DEFAULT__", {"config-objects": []})
def _set_scan_saving(self, cls=None):
# no special scan saving class for default session
if cls is not None:
log_warning(
self,
f"Not setting scan saving policy to {cls.__name__} in default session.",
)
log_warning(self, "No data policy allowed in this session.")
super()._set_scan_saving(None)
def enable_esrf_data_policy(self):
pass
def disable_esrf_data_policy(self):
pass
def _load_config(self, verbose=True):
return
pass
def resetup(self, verbose=False):
return
pass
......@@ -404,11 +404,12 @@ def test_issue_1924(beacon):
s2.close()
@pytest.mark.skip()
def test_issue_2218(beacon):
# No data policy allowed in the default session
scan_saving_cfg = beacon.root["scan_saving"]
scan_saving_cfg["class"] = "ESRFScanSaving"
default_session = session.DefaultSession()
env = dict()
default_session.setup(env_dict=env)
default_session.setup()
assert default_session.scan_saving.__class__.__name__ != "ESRFScanSaving"
default_session.enable_esrf_data_policy()
assert default_session.scan_saving.__class__.__name__ != "ESRFScanSaving"
Supports Markdown
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