Example #1
0
    def it_can_construct_from_a_bmp_stream(self, Bmp__init__):
        cx, cy, horz_dpi, vert_dpi = 26, 43, 200, 96
        bytes_ = (b'fillerfillerfiller\x1A\x00\x00\x00\x2B\x00\x00\x00'
                  b'fillerfiller\xB8\x1E\x00\x00\x00\x00\x00\x00')
        stream = BytesIO(bytes_)

        bmp = Bmp.from_stream(stream)

        Bmp__init__.assert_called_once_with(ANY, cx, cy, horz_dpi, vert_dpi)
        assert isinstance(bmp, Bmp)
Example #2
0
    def it_can_construct_from_a_bmp_stream(self, Bmp__init__):
        cx, cy, horz_dpi, vert_dpi = 26, 43, 200, 96
        bytes_ = (
            b'fillerfillerfiller\x1A\x00\x00\x00\x2B\x00\x00\x00'
            b'fillerfiller\xB8\x1E\x00\x00\x00\x00\x00\x00'
        )
        stream = BytesIO(bytes_)

        bmp = Bmp.from_stream(stream)

        Bmp__init__.assert_called_once_with(ANY, cx, cy, horz_dpi, vert_dpi)
        assert isinstance(bmp, Bmp)
Example #3
0
 def it_can_construct_from_a_bmp_stream(self, from_stream_fixture):
     stream, Bmp__init__, cx, cy, horz_dpi, vert_dpi = from_stream_fixture
     bmp = Bmp.from_stream(stream)
     Bmp__init__.assert_called_once_with(cx, cy, horz_dpi, vert_dpi)
     assert isinstance(bmp, Bmp)
Example #4
0
 def it_can_construct_from_a_bmp_stream(self, from_stream_fixture):
     stream, Bmp__init__, cx, cy, horz_dpi, vert_dpi = from_stream_fixture
     bmp = Bmp.from_stream(stream)
     Bmp__init__.assert_called_once_with(cx, cy, horz_dpi, vert_dpi)
     assert isinstance(bmp, Bmp)