mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
[Feat] Prevent objects with uuid names to be serialized to json.
This commit is contained in:
parent
779dedf5b3
commit
5c4f44fa01
2 changed files with 18 additions and 0 deletions
|
@ -409,3 +409,14 @@ def assert_equal_Obs(to, ro):
|
|||
print(kw, "does not match.")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def test_meas_uuid(tmp_path):
|
||||
meas = pe.Meas(0.3, 0.2)
|
||||
|
||||
for obs in [meas, meas + 1, meas * pe.pseudo_Obs(0.1, 0.001, "obs|r1")]:
|
||||
with pytest.raises(ValueError):
|
||||
jsonio.dump_to_json([obs], "test_file", indent=1, description='[This file should not be writable]')
|
||||
|
||||
name_meas = pe.Meas(0.3, 0.2, name="my name")
|
||||
jsonio.dump_to_json([name_meas], "test_file", indent=1, description='[This file should be writable]')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue