Skip to content

Commit 4b6bf56

Browse files
committed
add test for set_run_modes
1 parent 6e817a1 commit 4b6bf56

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

fooof/objs/fit.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,7 @@ def get_run_modes(self):
579579
Dictionary containing the run_modes from the current object.
580580
"""
581581

582-
return {key : getattr(self, key) \
583-
for key in OBJ_DESC['run_modes']}
582+
return {key : getattr(self, key) for key in OBJ_DESC['run_modes']}
584583

585584

586585
def get_meta_data(self):
@@ -737,7 +736,7 @@ def set_debug_mode(self, debug):
737736

738737
self._debug = debug
739738

740-
739+
741740
def set_check_modes(self, check_freqs=None, check_data=None):
742741
"""Set check modes, which controls if an error is raised based on check on the inputs.
743742
@@ -780,7 +779,7 @@ def set_run_modes(self, debug, check_freqs, check_data):
780779
check_data : bool
781780
Whether to run in check data mode.
782781
"""
783-
782+
784783
self.set_debug_mode(debug)
785784
self.set_check_modes(check_freqs, check_data)
786785

fooof/tests/core/test_info.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def test_get_description(tfm):
1515
for it in va:
1616
assert it in objs
1717

18-
1918
def test_get_peak_indices():
2019

2120
indices = get_peak_indices()
@@ -33,7 +32,6 @@ def test_get_ap_indices():
3332
for ind, val in enumerate(['offset', 'exponent']):
3433
assert indices_fixed[val] == ind
3534

36-
3735
indices_knee = get_indices('knee')
3836

3937
assert indices_knee

fooof/tests/objs/test_fit.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,13 @@ def test_fooof_set_check_modes(tfm):
445445
assert tfm._check_freqs is True
446446
assert tfm._check_data is True
447447

448+
def test_set_run_modes():
449+
450+
tfm = FOOOF(verbose=False)
451+
tfm.set_run_modes(False, False, False)
452+
for field in OBJ_DESC['run_modes']:
453+
assert getattr(tfm, field) is False
454+
448455
def test_fooof_to_df(tfm, tbands, skip_if_no_pandas):
449456

450457
df1 = tfm.to_df(2)

0 commit comments

Comments
 (0)