Skip to content

Commit

Permalink
:micrscope: test fast sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Oct 10, 2020
1 parent 3f746aa commit cfb2b80
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import os
from datetime import datetime, time

from nose.tools import eq_
from pyexcel_io._compact import OrderedDict

from pyexcel_xlsx import get_data


def test_reading():
data = get_data(
os.path.join("tests", "fixtures", "date_field.xlsx"),
library="pyexcel-xlsx",
skip_hidden_row_and_column=False
)
expected = OrderedDict()
expected.update(
{
"Sheet1": [
["Date", "Time"],
[
datetime(year=2014, month=12, day=25),
time(hour=11, minute=11, second=11),
],
[
datetime(2014, 12, 26, 0, 0),
time(hour=12, minute=12, second=12),
],
[
datetime(2015, 1, 1, 0, 0),
time(hour=13, minute=13, second=13),
],
[
datetime(year=1899, month=12, day=30),
datetime(1899, 12, 30, 0, 0),
],
]
}
)
expected.update({"Sheet2": []})
expected.update({"Sheet3": []})
eq_(data, expected)

0 comments on commit cfb2b80

Please sign in to comment.