def it_raises_on_unrecognized_image_stream(self): stream = BytesIO(b'foobar 666 not an image stream') with pytest.raises(UnrecognizedImageError): _ImageHeaderFactory(stream)
def it_constructs_the_right_class_for_a_given_image_stream( self, call_fixture): stream, expected_class = call_fixture image_header = _ImageHeaderFactory(stream) assert isinstance(image_header, expected_class)