Versie nummer in de module
This commit is contained in:
10
README.md
10
README.md
@@ -93,3 +93,13 @@ $ python -m lmwsip.run /tmp/hoek-h10.sip
|
||||
> [LO]
|
||||
< [! ]
|
||||
```
|
||||
|
||||
### Git pre commit hook
|
||||
|
||||
Er is een git pre-commit hook aanwezig in "githooks". Deze moet geactiveerd
|
||||
worden door hem te symlinken naar .git/hooks.
|
||||
|
||||
Deze git hook verzorgt een versie nummer en een syntax check voor commit.
|
||||
|
||||
Het versie nummer komt uit de setup.py en word in de module geplaats als
|
||||
`__version__`.
|
||||
|
7
githooks/pre-commit
Executable file
7
githooks/pre-commit
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=$(grep version setup.py | sed -e 's/.*="//' -e 's/",//')
|
||||
sed -i "s/^__version__ = .*/__version__ = '${VERSION}'/" lmwsip/__init__.py
|
||||
git add lmwsip/__init__.py
|
||||
|
||||
python setup.py test
|
@@ -11,6 +11,8 @@ import logging
|
||||
from datetime import datetime, timedelta
|
||||
from dateutil import tz
|
||||
|
||||
__version__ = '0.1.01'
|
||||
|
||||
class LmwSip:
|
||||
"""Class to connect to the LMW Standard Interface prototcol (sip)
|
||||
|
||||
|
@@ -129,6 +129,9 @@ class lmwsipTest(unittest.TestCase):
|
||||
sleep(2)
|
||||
self.assertEqual(self.sip.sendrecv("LOGOUTCOUNT"), "1\r")
|
||||
|
||||
def test_versionstr(self):
|
||||
self.assertEqual(type(lmwsip.__version__), str)
|
||||
|
||||
def test_run(self):
|
||||
capturedOutput = io.StringIO()
|
||||
sys.stdout = capturedOutput
|
||||
|
Reference in New Issue
Block a user