def test_loading_a_image_from_url(): """Tests the loading of a image from a url""" url = 'https://upload.wikimedia.org/wikipedia/commons/7/71/' \ '1700_CE_world_map.PNG' image_pane = PNG(url) image_data = image_pane._img() assert b'PNG' in image_data
def test_load_from_stringio(): """Testing a loading a image from a StringIO""" memory = StringIO() with open('panel/tests/test_data/logo.png', 'rb') as image_file: memory.write(str(image_file.read())) memory.seek(0) image_pane = PNG(memory) image_data = image_pane._img() assert 'PNG' in image_data
def test_load_from_byteio(): """Testing a loading a image from a ByteIo""" memory = BytesIO() with open('panel/tests/test_data/logo.png', 'rb') as image_file: memory.write(image_file.read()) memory.seek(0) image_pane = PNG(memory) image_data = image_pane._img() assert b'PNG' in image_data
def test_load_from_stringio(): """Testing a loading a image from a StringIO""" memory = StringIO() path = os.path.dirname(__file__) with open(os.path.join(path, '../test_data/logo.png'), 'rb') as image_file: memory.write(str(image_file.read())) image_pane = PNG(memory) image_data = image_pane._img() assert 'PNG' in image_data
def test_load_from_byteio(): """Testing a loading a image from a ByteIo""" memory = BytesIO() path = os.path.dirname(__file__) with open(os.path.join(path, '../test_data/logo.png'), 'rb') as image_file: memory.write(image_file.read()) memory.seek(0) image_pane = PNG(memory) image_data = image_pane._img() assert b'PNG' in image_data