improve packaging and test environment
This commit is contained in:
parent
3e200a86b9
commit
d672ca1268
10
setup.py
10
setup.py
|
@ -38,10 +38,10 @@ class Tox(TestCommand):
|
|||
sys.exit(errno)
|
||||
|
||||
setup(
|
||||
name='escpos',
|
||||
version='1.0.9',
|
||||
url='https://github.com/manpaz/python-escpos',
|
||||
download_url='https://github.com/manpaz/python-escpos.git',
|
||||
name='python-escpos',
|
||||
version='1.0.9-dev',
|
||||
url='https://github.com/python-escpos/python-escpos',
|
||||
download_url='https://github.com/python-escpos/python-escpos/archive/master.zip',
|
||||
description='Python library to manipulate ESC/POS Printers',
|
||||
license='GNU GPL v3',
|
||||
long_description=read('README'),
|
||||
|
@ -71,6 +71,6 @@ setup(
|
|||
'qrcode>=4.0',
|
||||
'pyserial',
|
||||
],
|
||||
tests_require=['tox'],
|
||||
tests_require=['tox', 'nose'],
|
||||
cmdclass={'test': Tox},
|
||||
)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/python
|
||||
"""very basic test cases that load the classes
|
||||
|
||||
:author: `Patrick Kanzler <patrick.kanzler@fablab.fau.de>`_ and others
|
||||
:organization: Bashlinux and `python-escpos <https://github.com/python-escpos>`_
|
||||
:author: `Patrick Kanzler <patrick.kanzler@fablab.fau.de>`_
|
||||
:organization: `python-escpos <https://github.com/python-escpos>`_
|
||||
:copyright: Copyright (c) 2016 `python-escpos <https://github.com/python-escpos>`_
|
||||
:license: GNU GPL v3
|
||||
"""
|
||||
|
@ -12,20 +12,22 @@ from nose.tools import with_setup
|
|||
import escpos.printer as printer
|
||||
import os
|
||||
|
||||
devfile = 'testfile'
|
||||
|
||||
def setup_testfile():
|
||||
"""create a testfile as devfile"""
|
||||
fhandle = open('testfile', 'a')
|
||||
fhandle = open(devfile, 'a')
|
||||
try:
|
||||
os.utime('testfile', None)
|
||||
os.utime(devfile, None)
|
||||
finally:
|
||||
fhandle.close()
|
||||
|
||||
def teardown_testfile():
|
||||
"""destroy testfile again"""
|
||||
os.remove('testfile')
|
||||
os.remove(devfile)
|
||||
|
||||
@with_setup(setup_testfile, teardown_testfile)
|
||||
def test_instantiation():
|
||||
"""test the instantiation of a escpos-printer class and basic printing"""
|
||||
instance = printer.File(devfile='testfile')
|
||||
instance = printer.File(devfile=devfile)
|
||||
instance.text('This is a test\n')
|
||||
|
|
Loading…
Reference in New Issue