Skip to content

Commit d595aae

Browse files
committed
Preparation for Upload to Pip. Small improvements on test script.
1 parent afeb5a7 commit d595aae

File tree

4 files changed

+36
-14
lines changed

4 files changed

+36
-14
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ target/
6161

6262
# Local databases
6363
*.db
64+
/protokoll Kommunikation

maxcul/test/test_maxcul.py

+16
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,22 @@ def test_time_information(self):
123123
self.assertEqual(msg.payload, "0E0102E117")
124124
self.assertEqual(msg.decoded_payload, datetime(2014, 12, 1, 2, 33, 23))
125125

126+
def test_wallthermostat_control_message(self):
127+
sample = "Z0CB9044217A95512DC400019D9"
128+
msg = MoritzMessage.decode_message(sample)
129+
self.assertTrue(isinstance(msg, WallThermostatControlMessage))
130+
self.assertEqual(msg.counter, 0xB9)
131+
self.assertEqual(msg.flag, 0x04)
132+
self.assertEqual(msg.sender_id, 0x17A955)
133+
self.assertEqual(msg.receiver_id, 0x12DC40)
134+
self.assertEqual(msg.group_id, 0)
135+
self.assertEqual(msg.payload, "19D9")
136+
self.assertEqual(msg.decoded_payload, {
137+
"desired_temprature": 12,
138+
"temprature": 21
139+
})
140+
#wallthermostat updated <WallThermostatStateMessage counter:c0 flag:4 sender:17a955 receiver:0 group:0 payload:59011900D9>
141+
126142

127143
class MessageGeneralOutputTestCase(unittest.TestCase):
128144
def test_encoding_without_payload(self):

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pytest
12
blinker
23
detach
34
flask

setup.py

+18-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
from setuptools import setup, find_packages
2-
from setuptools.command.test import test as TestCommand
1+
from setuptools import setup
2+
from setuptools.command.test import test as testcommand
33

44
import io
5-
import codecs
65
import os
76
import sys
87

98
import maxcul
109

1110
here = os.path.abspath(os.path.dirname(__file__))
1211

12+
1313
def read(*filenames, **kwargs):
1414
encoding = kwargs.get('encoding', 'utf-8')
1515
sep = kwargs.get('sep', '\n')
@@ -19,11 +19,13 @@ def read(*filenames, **kwargs):
1919
buf.append(f.read())
2020
return sep.join(buf)
2121

22+
2223
long_description = read('README', 'CHANGELOG')
2324

24-
class PyTest(TestCommand):
25+
26+
class PyTest(testcommand):
2527
def finalize_options(self):
26-
TestCommand.finalize_options(self)
28+
testcommand.finalize_options(self)
2729
self.test_args = []
2830
self.test_suite = True
2931

@@ -32,19 +34,21 @@ def run_tests(self):
3234
errcode = pytest.main(self.test_args)
3335
sys.exit(errcode)
3436

37+
3538
setup(
3639
name='maxcul',
3740
version=maxcul.__version__,
3841
url='https://github.com/karlTGA/MaxCul-Python',
3942
license='BSD License',
40-
author='Karl Wolffgang',
43+
author='Markus Ullmann, Karl Wolffgang',
4144
tests_require=['pytest'],
4245
install_requires=['Flask>=0.12',
43-
'Flask-SQLAlchemy>=2.1',
44-
'blinker>=1.4',
45-
'detach>=1.0',
46-
'pyserial>=3.1.1'
47-
],
46+
'Flask-SQLAlchemy>=2.1',
47+
'blinker>=1.4',
48+
'detach>=1.0',
49+
'pyserial>=3.1.1',
50+
'pytest>=3.0.5'
51+
],
4852
cmdclass={'test': PyTest},
4953
author_email='[email protected]',
5054
description='Access with Python MAX! Devices over a CUL Stick',
@@ -53,7 +57,7 @@ def run_tests(self):
5357
include_package_data=True,
5458
platforms='any',
5559
test_suite='maxcul.test.test_maxcul',
56-
classifiers = [
60+
classifiers=[
5761
'Programming Language :: Python',
5862
'Development Status :: 4 - Beta',
5963
'Natural Language :: English',
@@ -63,8 +67,8 @@ def run_tests(self):
6367
'Operating System :: OS Independent',
6468
'Topic :: Software Development :: Libraries :: Python Modules',
6569
'Topic :: Home Automation'
66-
],
70+
],
6771
extras_require={
6872
'testing': ['pytest'],
6973
}
70-
)
74+
)

0 commit comments

Comments
 (0)