Пример #1
0
def test_read_lines():
    sample_path = osp.join(BASE_DIR, 'data/fileio/sample.txt')
    lines = omnipack.read_lines(sample_path)

    assert len(lines) == 2
    assert lines[0] == 'a=1'
    assert lines[1] == 'b=2'
Пример #2
0
def test_tsv2csv():
    sample_path = osp.join(BASE_DIR, 'data/fileio/sample.tsv')
    output_path = osp.join(BASE_DIR, 'data/fileio/test_output.csv')
    expected_output_path = osp.join(BASE_DIR, 'data/fileio/sample.csv')

    omnipack.tsv2csv(sample_path, output_path)

    output = omnipack.read_lines(output_path)
    expected = omnipack.read_lines(expected_output_path)

    assert len(output) == len(expected)

    for i in range(len(output)):
        assert output[i] == expected[i]

    os.remove(output_path)
Пример #3
0
def test_write_lines():
    sample_path = osp.join(BASE_DIR, 'data/fileio/sample.txt')
    output_path = osp.join(BASE_DIR, 'data/fileio/temp.txt')

    lines = ['a=1', 'b=2']

    omnipack.write_lines(lines, output_path)

    sample_lines = omnipack.read_lines(sample_path)
    output_lines = omnipack.read_lines(output_path)

    assert len(sample_lines) == len(output_lines)

    for i in range(len(sample_lines)):
        assert sample_lines[i] == output_lines[i]

    os.remove(output_path)
Пример #4
0
    with open('README.md', encoding='utf-8') as f:
        content = f.read()
    return content


if __name__ == '__main__':
    setup(
        name='omnipack',
        version=omnipack.__version__,
        description='A robust collection of useful scripts',
        long_description=readme(),
        long_description_content_type="text/markdown",
        author='Li Shenggui',
        author_email='*****@*****.**',
        url='https://github.com/FrankLeeeee/powerpack',
        keywords='Python, scripts',
        packages=find_packages(),
        classifiers=[
            'Development Status :: 4 - Beta',
            'License :: OSI Approved :: Apache Software License',
            'Operating System :: OS Independent',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.5',
            'Programming Language :: Python :: 3.6',
            'Programming Language :: Python :: 3.7',
        ],
        license='Apache License 2.0',
        install_requires=omnipack.read_lines('requirements/requirements.txt'),
        zip_safe=False,
        entry_points={'console_scripts': ['omnipack = omnipack.command:cli']})