def test_to_image(self, image): tile = GBTile.from_image(image, 32) tile_image = tile.to_image() assert tile_image.getpixel((0, 0)) == 0b00 assert tile_image.getpixel((0, 6)) == 0b01 assert tile_image.getpixel((2, 6)) == 0b10 assert tile_image.getpixel((5, 0)) == 0b11
def tile(self, image): return GBTile.from_image(image, 8, 0)
def test_get_pixel(self, image): tile = GBTile.from_image(image, 32) assert tile.get_pixel(0, 0) == 0b00 assert tile.get_pixel(0, 6) == 0b01 assert tile.get_pixel(2, 6) == 0b10 assert tile.get_pixel(5, 0) == 0b11
def test_from_image(self, image, x, result): tile = GBTile.from_image(image, x) assert tile.to_hex_string() == result