Exemple #1
0
    def it_can_construct_from_an_image_stream(self, from_stream_fixture):
        stream_, blob_, filename_in = from_stream_fixture[:3]
        _ImageHeaderFactory_, image_header_ = from_stream_fixture[3:5]
        Image__init_, filename_out = from_stream_fixture[5:]

        image = Image._from_stream(stream_, blob_, filename_in)

        _ImageHeaderFactory_.assert_called_once_with(stream_)
        Image__init_.assert_called_once_with(ANY, blob_, filename_out,
                                             image_header_)
        assert isinstance(image, Image)
Exemple #2
0
 def it_can_construct_from_an_image_stream(self, from_stream_fixture):
     # fixture ----------------------
     stream_, blob_, filename_in = from_stream_fixture[:3]
     _ImageHeaderFactory_, image_header_ = from_stream_fixture[3:5]
     Image__init_, filename_out = from_stream_fixture[5:]
     # exercise ---------------------
     image = Image._from_stream(stream_, blob_, filename_in)
     # verify -----------------------
     _ImageHeaderFactory_.assert_called_once_with(stream_)
     Image__init_.assert_called_once_with(
         blob_, filename_out, image_header_
     )
     assert isinstance(image, Image)