/usr/lib/python2.7/dist-packages/openpyxl/tests/test_read.py is in python-openpyxl 2.4.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl
import pytest
# compatibility imports
from openpyxl.compat import unicode
# package imports
from openpyxl.worksheet import Worksheet
from openpyxl.workbook import Workbook
from openpyxl.styles import numbers
from openpyxl.reader.excel import load_workbook
@pytest.mark.parametrize("cell, number_format",
[
('A1', numbers.FORMAT_GENERAL),
('A2', numbers.FORMAT_DATE_XLSX14),
('A3', numbers.FORMAT_NUMBER_00),
('A4', numbers.FORMAT_DATE_TIME3),
('A5', numbers.FORMAT_PERCENTAGE_00),
]
)
def test_read_general_style(datadir, cell, number_format):
datadir.join("genuine").chdir()
wb = load_workbook('empty-with-styles.xlsx')
ws = wb["Sheet1"]
assert ws[cell].number_format == number_format
def test_read_no_theme(datadir):
datadir.join("genuine").chdir()
wb = load_workbook('libreoffice_nrt.xlsx')
assert wb
@pytest.mark.parametrize("guess_types, dtype",
(
(True, float),
(False, unicode),
)
)
def test_guess_types(datadir, guess_types, dtype):
datadir.join("genuine").chdir()
wb = load_workbook('guess_types.xlsx', guess_types=guess_types)
ws = wb.active
assert isinstance(ws['D2'].value, dtype)
|