@@ -114,6 +114,10 @@ def test_log_checks(self):
114
114
assert_equal (message , 'sizeof_hdr should be 348; '
115
115
'set sizeof_hdr to 348' )
116
116
assert_raises (* raiser )
117
+ # RGB datatype does not raise error
118
+ hdr = HC ()
119
+ hdr .set_data_dtype ('RGB' )
120
+ fhdr , message , raiser = self .log_chk (hdr , 0 )
117
121
# datatype not recognized
118
122
hdr = HC ()
119
123
hdr ['datatype' ] = - 1 # severity 40
@@ -194,14 +198,17 @@ def test_data_dtype(self):
194
198
(8 , np .int32 ),
195
199
(16 , np .float32 ),
196
200
(32 , np .complex64 ),
197
- (64 , np .float64 ))
201
+ (64 , np .float64 ),
202
+ (128 , np .dtype ([('R' ,'u1' ),
203
+ ('G' , 'u1' ),
204
+ ('B' , 'u1' )])))
198
205
# and unsupported - here using some labels instead
199
206
unsupported_types = (np .void , 'none' , 'all' , 0 )
200
207
hdr = self .header_class ()
201
208
for code , npt in supported_types :
202
209
# Can set with code value, or numpy dtype, both return the
203
210
# dtype as output on get
204
- hdr .set_data_dtype (npt )
211
+ hdr .set_data_dtype (code )
205
212
assert_equal (hdr .get_data_dtype (), npt )
206
213
for inp in unsupported_types :
207
214
assert_raises (HeaderDataError ,
0 commit comments