-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #699 from nicholsonbt/unify_cuts
[ENH] Preprocess Spectra: Unify cuts
- Loading branch information
Showing
4 changed files
with
52 additions
and
18 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
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,32 @@ | ||
from orangecontrib.spectroscopy.tests.test_owpreprocess import PreprocessorEditorTest | ||
from orangecontrib.spectroscopy.widgets.owpreprocess import OWPreprocess | ||
from orangecontrib.spectroscopy.tests.test_preprocess import SMALL_COLLAGEN | ||
from orangecontrib.spectroscopy.widgets.preprocessors.misc import CutEditor | ||
from orangecontrib.spectroscopy.preprocess import Cut | ||
|
||
|
||
class TestCutEditor(PreprocessorEditorTest): | ||
|
||
def setUp(self): | ||
self.widget = self.create_widget(OWPreprocess) | ||
self.editor = self.add_editor(CutEditor, self.widget) | ||
self.data = SMALL_COLLAGEN | ||
self.send_signal(self.widget.Inputs.data, self.data) | ||
self.wait_for_preview() # ensure initialization with preview data | ||
|
||
def test_no_interaction(self): | ||
p = self.commit_get_preprocessor() | ||
self.assertIsInstance(p, Cut) | ||
self.assertEqual(p.lowlim, 995.902) | ||
self.assertEqual(p.highlim, 1711.779) | ||
self.assertEqual(p.inverse, False) | ||
|
||
def test_basic(self): | ||
self.editor.lowlim = 5 | ||
self.editor.highlim = 10 | ||
self.editor.inverse = True | ||
self.editor.edited.emit() | ||
p = self.commit_get_preprocessor() | ||
self.assertEqual(p.lowlim, 5) | ||
self.assertEqual(p.highlim, 10) | ||
self.assertEqual(p.inverse, True) |
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