update tests and add long description to setup

This commit is contained in:
iuvbio 2019-01-30 23:25:37 +01:00
parent a140a5d4b9
commit f6ed9d088f
2 changed files with 34 additions and 33 deletions

View File

@ -1,43 +1,39 @@
import os import os
import sys import sys
import pandas as pd
from pandas_ods_reader import read_ods from pandas_ods_reader import read_ods
root = os.path.dirname(os.path.abspath(__file__)) root = os.path.dirname(os.path.abspath(__file__))
def test_header_file(): class OdsReaderTest(object):
example = "example_headers.ods" def test_header_file_with_int():
path = os.path.join(root, example) example = "example_headers.ods"
print("Test sheet by index") path = os.path.join(root, example)
df = read_ods(path, 1) # print("Test sheet by index")
print(df) df = read_ods(path, 1)
print("Test sheet by name") assert isinstance(df, pd.DataFrame)
df = read_ods(path, "Sheet1")
print(df)
def test_header_file_with_str():
example = "example_headers.ods"
path = os.path.join(root, example)
df = read_ods(path, "Sheet1")
print(df)
assert isinstance(df, pd.DataFrame)
def test_no_header_file(): def test_no_header_file():
example = "example_no_headers.ods" example = "example_no_headers.ods"
path = os.path.join(root, example) path = os.path.join(root, example)
print("Test sheet by index and default columns") print("Test sheet by index and default columns")
df = read_ods(path, 1, headers=False) df = read_ods(path, 1, headers=False)
print(df) print(df)
print("Test sheet by name and default columns") print("Test sheet by name and default columns")
df = read_ods(path, "Sheet1", headers=False) df = read_ods(path, "Sheet1", headers=False)
print(df) print(df)
print("Test sheet by index and specific columns") print("Test sheet by index and specific columns")
columns = ["A", "B", "C", "D", "E"] columns = ["A", "B", "C", "D", "E"]
df = read_ods(path, 1, headers=False, columns=columns) df = read_ods(path, 1, headers=False, columns=columns)
print(df) print(df)
def main():
test_header_file()
test_no_header_file()
if __name__ == "__main__":
status = main()
sys.exit(status)

View File

@ -1,11 +1,16 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
VERSION = "0.0.3" VERSION = "0.0.4"
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name="pandas_ods_reader", setup(name="pandas_ods_reader",
version=VERSION, version=VERSION,
description="Read in an ODS file and return it as a pandas.DataFrame", description="Read in an ODS file and return it as a pandas.DataFrame",
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[ classifiers=[
'Development Status :: 3 - Alpha', 'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License', 'License :: OSI Approved :: MIT License',