diff options
author | Picca Frédéric-Emmanuel <picca@debian.org> | 2017-10-07 07:59:01 +0200 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@debian.org> | 2017-10-07 07:59:01 +0200 |
commit | bfa4dba15485b4192f8bbe13345e9658c97ecf76 (patch) | |
tree | fb9c6e5860881fbde902f7cbdbd41dc4a3a9fb5d /silx/math/test/test_histogramnd_error.py | |
parent | f7bdc2acff3c13a6d632c28c4569690ab106eed7 (diff) |
New upstream version 0.6.0+dfsg
Diffstat (limited to 'silx/math/test/test_histogramnd_error.py')
-rw-r--r-- | silx/math/test/test_histogramnd_error.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/silx/math/test/test_histogramnd_error.py b/silx/math/test/test_histogramnd_error.py index 575eaf0..a8c66a0 100644 --- a/silx/math/test/test_histogramnd_error.py +++ b/silx/math/test/test_histogramnd_error.py @@ -426,6 +426,28 @@ class Test_chistogramnd_1D_errors(_Test_chistogramnd_errors): (np.uint16, np.double), (np.uint16, np.uint16)) +class Test_chistogramnd_ND_range(unittest.TestCase): + """ + + """ + + def test_invalid_histo_range(self): + data = np.random.random((60, 60)) + nbins = 10 + + with self.assertRaises(ValueError): + histo_range = data.min(), np.inf + + Histogramnd(sample=data.ravel(), + histo_range=histo_range, + n_bins=nbins) + + histo_range = data.min(), np.nan + + Histogramnd(sample=data.ravel(), + histo_range=histo_range, + n_bins=nbins) + class Test_chistogramnd_ND_errors(_Test_chistogramnd_errors): """ @@ -497,7 +519,8 @@ class Test_chistogramnd_ND_errors(_Test_chistogramnd_errors): test_cases = (Test_chistogramnd_1D_errors, - Test_chistogramnd_ND_errors,) + Test_chistogramnd_ND_errors, + Test_chistogramnd_ND_range) def suite(): |