-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41323ba
commit 21ebd02
Showing
11 changed files
with
173 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
meggie/actions/raw_events_from_annotations/tests/test_raw_events_from_annotations.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import mne | ||
|
||
from meggie.utilities.testing import BaseTestAction | ||
from meggie.actions.raw_events_from_annotations import EventsFromAnnotations | ||
from meggie.actions.raw_events_from_annotations.dialogs.eventsFromAnnotationsDialogMain import ( | ||
EventsFromAnnotationsDialog, | ||
) | ||
|
||
|
||
class TestRawEventsFromAnnotations(BaseTestAction): | ||
|
||
def setup_experiment(self): | ||
BaseTestAction.setup_experiment(self) | ||
raw = self.experiment.active_subject.get_raw() | ||
|
||
# create one annotation named "CAT" | ||
annotations = mne.Annotations([2], [1], ["CAT"]) | ||
raw.set_annotations(annotations) | ||
|
||
def test_raw_events_from_annotations(self): | ||
self.run_action( | ||
action_name="raw_events_from_annotations", | ||
handler=EventsFromAnnotations, | ||
patch_paths=[ | ||
"meggie.actions.raw_events_from_annotations.dialogs.eventsFromAnnotationsDialogMain" | ||
], | ||
) | ||
dialog = self.find_dialog(EventsFromAnnotationsDialog) | ||
dialog.items = [("CAT", 99, True)] | ||
dialog.accept() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from meggie.utilities.testing import BaseTestAction | ||
from meggie.actions.raw_filter import Filter | ||
from meggie.actions.raw_filter.dialogs.filterDialogMain import ( | ||
FilterDialog, | ||
) | ||
|
||
|
||
class TestRawFilter(BaseTestAction): | ||
def test_raw_filter(self): | ||
|
||
self.run_action( | ||
action_name="raw_filter", | ||
handler=Filter, | ||
patch_paths=["meggie.actions.raw_filter.dialogs.filterDialogMain"], | ||
) | ||
dialog = self.find_dialog(FilterDialog) | ||
dialog.accept() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from meggie.utilities.testing import BaseTestAction | ||
from meggie.actions.raw_ica import ICA | ||
from meggie.actions.raw_ica.dialogs.icaDialogMain import ( | ||
ICADialog, | ||
) | ||
|
||
|
||
class TestRawICA(BaseTestAction): | ||
def test_raw_ica(self): | ||
|
||
self.run_action( | ||
action_name="raw_ica", | ||
handler=ICA, | ||
patch_paths=["meggie.actions.raw_ica.dialogs.icaDialogMain"], | ||
) | ||
dialog = self.find_dialog(ICADialog) | ||
|
||
# Compute the components | ||
dialog.ui.doubleSpinBoxNComponents.setValue(0.3) | ||
dialog.ui.pushButtonCompute.click() | ||
|
||
# Select first item | ||
dialog.ui.listWidgetNotRemoved.setCurrentRow(0) | ||
|
||
# Try all the plots | ||
dialog.ui.pushButtonPlotTopographies.click() | ||
dialog.ui.pushButtonPlotSources.click() | ||
dialog.ui.pushButtonPlotProperties.click() | ||
|
||
# Transfer to be removed | ||
dialog.ui.pushButtonTransfer.click() | ||
|
||
# Try plotting changes | ||
dialog.ui.pushButtonPlotChanges.click() | ||
|
||
# Finish | ||
dialog.accept() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from meggie.utilities.testing import BaseTestAction | ||
from meggie.actions.raw_montage import Montage | ||
from meggie.actions.raw_montage.dialogs.montageDialogMain import ( | ||
MontageDialog, | ||
) | ||
|
||
|
||
class TestRawMontage(BaseTestAction): | ||
|
||
def setup_experiment(self): | ||
BaseTestAction.setup_experiment(self) | ||
raw = self.experiment.active_subject.get_raw() | ||
|
||
# rename channels to match the one lucky montage that comes in mne | ||
raw.rename_channels( | ||
dict( | ||
[ | ||
(old, old.split(" ")[0] + old.split(" ")[1]) | ||
for old in raw.info["ch_names"] | ||
] | ||
) | ||
) | ||
|
||
def test_raw_montage(self): | ||
|
||
self.run_action( | ||
action_name="raw_montage", | ||
handler=Montage, | ||
patch_paths=["meggie.actions.raw_montage.dialogs.montageDialogMain"], | ||
) | ||
dialog = self.find_dialog(MontageDialog) | ||
dialog.ui.comboBoxSelectFromList.setCurrentText("mgh60.elc") | ||
dialog.accept() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
meggie/actions/raw_rereference/tests/test_raw_rereference.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from meggie.utilities.testing import BaseTestAction | ||
from meggie.actions.raw_rereference import Rereference | ||
from meggie.actions.raw_rereference.dialogs.rereferencingDialogMain import ( | ||
RereferencingDialog, | ||
) | ||
|
||
|
||
class TestRawRereference(BaseTestAction): | ||
def test_raw_rereference(self): | ||
|
||
self.run_action( | ||
action_name="raw_rereference", | ||
handler=Rereference, | ||
patch_paths=[ | ||
"meggie.actions.raw_rereference.dialogs.rereferencingDialogMain" | ||
], | ||
) | ||
dialog = self.find_dialog(RereferencingDialog) | ||
dialog.accept() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from meggie.utilities.testing import BaseTestAction | ||
from meggie.actions.raw_resample import Resample | ||
from meggie.actions.raw_resample.dialogs.resamplingDialogMain import ( | ||
ResamplingDialog, | ||
) | ||
|
||
|
||
class TestRawResample(BaseTestAction): | ||
def test_raw_resample(self): | ||
|
||
self.run_action( | ||
action_name="raw_resample", | ||
handler=Resample, | ||
patch_paths=["meggie.actions.raw_resample.dialogs.resamplingDialogMain"], | ||
) | ||
dialog = self.find_dialog(ResamplingDialog) | ||
dialog.accept() |