|
52 | 52 |
|
53 | 53 | from nose import SkipTest
|
54 | 54 | from nose.tools import (assert_true, assert_false, assert_raises,
|
55 |
| - assert_equal, assert_not_equal) |
| 55 | + assert_equal, assert_not_equal, assert_greater_equal) |
56 | 56 |
|
57 | 57 | from numpy.testing import (assert_almost_equal, assert_array_equal)
|
58 | 58 |
|
@@ -131,6 +131,22 @@ def validate_asarray(self, pmaker, params):
|
131 | 131 | # Shape matches expected shape
|
132 | 132 | assert_equal(out.shape, params['shape'])
|
133 | 133 |
|
| 134 | + def validate_get_scaled(self, pmaker, params): |
| 135 | + # Check proxy returns expected array from asarray |
| 136 | + prox, fio, hdr = pmaker() |
| 137 | + out = prox.get_scaled() |
| 138 | + assert_array_equal(out, params['arr_out']) |
| 139 | + assert_dt_equal(out.dtype, params['dtype_out']) |
| 140 | + # Shape matches expected shape |
| 141 | + assert_equal(out.shape, params['shape']) |
| 142 | + |
| 143 | + for dtype in (np.float16, np.float32, np.float64, np.float128): |
| 144 | + out = prox.get_scaled(dtype=dtype) |
| 145 | + assert_almost_equal(out, params['arr_out']) |
| 146 | + assert_greater_equal(out.dtype, np.dtype(dtype)) |
| 147 | + # Shape matches expected shape |
| 148 | + assert_equal(out.shape, params['shape']) |
| 149 | + |
134 | 150 | def validate_header_isolated(self, pmaker, params):
|
135 | 151 | # Confirm altering input header has no effect
|
136 | 152 | # Depends on header providing 'get_data_dtype', 'set_data_dtype',
|
|
0 commit comments