File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,10 +33,9 @@ class Trace:
3333 def __init__ (self , filepath , json_file : str ):
3434 # store file paths
3535 self .filepath = filepath
36- if json_file [- 5 :] == '.json' :
37- self .json_file = json_file
38- else :
39- self .json_file = json_file + '.json'
36+ self .json_file = json_file
37+ if not json_file .endswith ('.json' ):
38+ self .json_file += '.json'
4039
4140 # load json file
4241 with open (os .path .join (self .filepath , self .json_file )) as f :
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ def test_protocol_descriptions(self):
4141 self .assertLess (t_error , 1e-2 )
4242 self .assertLess (v_error , 1e-4 )
4343
44+ def test_get_protocol_description (self ):
45+ a = np .array (self .trace .get_protocol_description ())
46+ b = np .array (self .trace .get_voltage_protocol ().get_all_sections ())
47+ self .assertEqual (a .shape , b .shape )
48+ self .assertTrue (np .all (a == b ))
49+
4450 def test_protocol_export (self ):
4551 with tempfile .TemporaryDirectory () as d :
4652 protocol = self .trace .get_voltage_protocol ()
You can’t perform that action at this time.
0 commit comments