def it_can_construct_from_a_tiff_stream(self, from_stream_fixture): (stream_, _TiffParser_, Tiff__init_, px_width, px_height, horz_dpi, vert_dpi) = from_stream_fixture tiff = Tiff.from_stream(stream_) _TiffParser_.parse.assert_called_once_with(stream_) Tiff__init_.assert_called_once_with(px_width, px_height, horz_dpi, vert_dpi) assert isinstance(tiff, Tiff)
def it_can_construct_from_a_tiff_stream(self, from_stream_fixture): (stream_, _TiffParser_, Tiff__init_, px_width, px_height, horz_dpi, vert_dpi) = from_stream_fixture tiff = Tiff.from_stream(stream_) _TiffParser_.parse.assert_called_once_with(stream_) Tiff__init_.assert_called_once_with( px_width, px_height, horz_dpi, vert_dpi ) assert isinstance(tiff, Tiff)
def it_can_construct_from_a_tiff_stream(self, stream_, _TiffParser_, tiff_parser_, Tiff__init_): px_width, px_height = 111, 222 horz_dpi, vert_dpi = 333, 444 tiff_parser_.px_width = px_width tiff_parser_.px_height = px_height tiff_parser_.horz_dpi = horz_dpi tiff_parser_.vert_dpi = vert_dpi tiff = Tiff.from_stream(stream_) _TiffParser_.parse.assert_called_once_with(stream_) Tiff__init_.assert_called_once_with(ANY, px_width, px_height, horz_dpi, vert_dpi) assert isinstance(tiff, Tiff)
def it_can_construct_from_a_tiff_stream( self, stream_, _TiffParser_, tiff_parser_, Tiff__init_ ): px_width, px_height = 111, 222 horz_dpi, vert_dpi = 333, 444 tiff_parser_.px_width = px_width tiff_parser_.px_height = px_height tiff_parser_.horz_dpi = horz_dpi tiff_parser_.vert_dpi = vert_dpi tiff = Tiff.from_stream(stream_) _TiffParser_.parse.assert_called_once_with(stream_) Tiff__init_.assert_called_once_with( ANY, px_width, px_height, horz_dpi, vert_dpi ) assert isinstance(tiff, Tiff)
def it_knows_its_default_ext(self): tiff = Tiff(None, None, None, None) assert tiff.default_ext == 'tiff'
def it_knows_its_content_type(self): tiff = Tiff(None, None, None, None) assert tiff.content_type == MIME_TYPE.TIFF