Skip to content

Commit

Permalink
Add test case for single string autosave kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
jsouter committed Sep 10, 2024
1 parent ea36dca commit a276d57
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_autosave.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,10 @@ def test_autosave_arguments(tmp_path):
builder.aOut("TRUE", autosave=True)
builder.aOut("FIELDS", autosave=["LOPR", "HOPR"])
builder.aOut("FALSE", autosave=False)
assert set(autosave.Autosave._pvs) == {"TRUE", "FIELDS.LOPR", "FIELDS.HOPR"}
builder.aOut("SINGLE-FIELD", autosave="EGU")
builder.aOut("AUTO-VAL", autosave="VAL")
assert set(autosave.Autosave._pvs) == {
"TRUE", "FIELDS.LOPR", "FIELDS.HOPR", "SINGLE-FIELD.EGU", "AUTO-VAL"}
autosave.Autosave._pvs = {}
builder.ClearRecords()
with autosave.Autosave(): # True by default
Expand All @@ -482,3 +485,8 @@ def test_autosave_arguments(tmp_path):
builder.aOut("AUTO-FALSE")
builder.aOut("AUTO-TRUE", autosave=True)
assert set(autosave.Autosave._pvs) == {"AUTO-TRUE"}
autosave.Autosave._pvs = {}
builder.ClearRecords()
with autosave.Autosave("LOPR"): # single field
builder.aOut("FIELDS", autosave="HOPR")
assert set(autosave.Autosave._pvs) == {"FIELDS.HOPR", "FIELDS.LOPR"}

0 comments on commit a276d57

Please sign in to comment.