File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,22 @@ def test_mappingness(self):
183183 assert_equal (hdr .get (keys [0 ]), vals [0 ])
184184 assert_equal (hdr .get (keys [0 ], 'default' ), vals [0 ])
185185
186+ # make sure .get returns values
187+ # which evaluate to False. We
188+ # have to use a different falsy
189+ # value depending on the data
190+ # type of the first header field.
191+ if np .issubdtype (hdr_dt [0 ], np .number ):
192+ falsyval = 0
193+ else :
194+ falsyval = ''
195+
196+ hdr [keys [0 ]] = falsyval
197+ assert_equal (hdr [keys [0 ]], falsyval )
198+ assert_equal (hdr .get (keys [0 ]), falsyval )
199+ assert_equal (hdr .get (keys [0 ], - 1 ), falsyval )
200+
201+
186202 def test_endianness_ro (self ):
187203 # endianness is a read only property
188204 ''' Its use in initialization tested in the init tests.
You can’t perform that action at this time.
0 commit comments