示例#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)
示例#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)
示例#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)
示例#4
0
 def it_knows_its_default_ext(self):
     bmp = Bmp(None, None, None, None)
     assert bmp.default_ext == 'bmp'
示例#5
0
 def it_knows_its_content_type(self):
     bmp = Bmp(None, None, None, None)
     assert bmp.content_type == MIME_TYPE.BMP
示例#6
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)