File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,21 @@ def test_run_data(tmpdir, raw_pair_data):
5656 rd .set (alpha = 1. , name = name )
5757
5858 # Test getting
59- rd .get ("alpha" , name = name )
6059 with pytest .raises (ValueError ):
6160 rd .get ("alpha" )
61+ assert rd .get ("alpha" , name = name ) == 1.
6262
6363 # Test read/write of the state
6464 rd .save_config ("{}/state.json" .format (tmpdir ))
65- old_rd = rd
66- rd = RunData .create_from ("{}/state.json" .format (tmpdir ))
65+ modified_rd = rd
66+ rd = RunData .create_from (pairs )
67+ assert rd .get ("alpha" , name = name ) != 1.
68+ assert modified_rd .as_dictionary () != rd .as_dictionary ()
6769
68- assert old_rd .as_dictionary () != rd .as_dictionary ()
69- rd .set (alpha = 1. , name = name )
7070 # Confirm that the restored data is the same as the original.
71- assert old_rd .as_dictionary () == rd .as_dictionary ()
71+ rd = RunData .create_from ("{}/state.json" .format (tmpdir ))
72+ assert rd .get ("alpha" , name = name ) == 1.
73+ assert modified_rd .as_dictionary () == rd .as_dictionary ()
7274
7375 with tempfile .NamedTemporaryFile (suffix = '.json' , mode = 'w' ) as tmp :
7476 test_data = raw_pair_data .copy ()
You can’t perform that action at this time.
0 commit comments