File: test_embed_image.py

package info (click to toggle)
libxlsxwriter 1.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,888 kB
  • sloc: ansic: 65,861; python: 2,106; makefile: 693; perl: 229; sh: 224; xml: 168; cpp: 73; javascript: 5
file content (68 lines) | stat: -rw-r--r-- 2,134 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
###############################################################################
#
# Tests for libxlsxwriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright 2014-2026, John McNamara, jmcnamara@cpan.org.
#

import os
import pytest
import base_test_class

class TestCompareXLSXFiles(base_test_class.XLSXBaseTest):
    """
    Test file created with libxlsxwriter against a file created by Excel.

    """

    def test_embed_image01(self):
        self.run_exe_test('test_embed_image01')

    # Some of the following tests require MD5 hash support to remove duplicate images.
    @pytest.mark.skipif(os.environ.get('USE_NO_MD5'), reason="compiled without MD5 support")
    def test_embed_image02(self):
        self.run_exe_test('test_embed_image02')

    def test_embed_image03(self):
        self.run_exe_test('test_embed_image03')

    def test_embed_image04(self):
        self.run_exe_test('test_embed_image04')

    def test_embed_image05(self):
        self.run_exe_test('test_embed_image05')

    def test_embed_image06(self):
        self.run_exe_test('test_embed_image06')

    def test_embed_image07(self):
        self.run_exe_test('test_embed_image07')

    def test_embed_image08(self):
        self.run_exe_test('test_embed_image08')

    def test_embed_image09(self):
        self.run_exe_test('test_embed_image09')

    def test_embed_image10(self):
        # Ignore the missing "display" parameter.
        self.ignore_elements = {'xl/worksheets/sheet1.xml': ['<hyperlink']}
        self.run_exe_test('test_embed_image10')

    def test_embed_image13(self):
        self.run_exe_test('test_embed_image11')
    def test_embed_image12(self):
        self.run_exe_test('test_embed_image12')

    @pytest.mark.skipif(os.environ.get('USE_NO_MD5'), reason="compiled without MD5 support")
    def test_embed_image13(self):
        self.run_exe_test('test_embed_image13')

    # Test in-memory image handling.
    def test_embed_image51(self):
        self.run_exe_test('test_embed_image51', 'embed_image01.xlsx')

    def test_embed_image52(self):
        self.run_exe_test('test_embed_image52', 'embed_image08.xlsx')