Noxfile adjustment, simple test

This commit is contained in:
Paul Warren 2024-10-09 17:08:43 +11:00
parent dd923fbaa7
commit d489d2c5b9
2 changed files with 19 additions and 4 deletions

View file

@ -1,11 +1,12 @@
import nox
@nox.session
def lint(session):
session.install('ruff')
session.run('ruff', 'check', '--exclude', 'examples')
@nox.session
def tests(session):
session.install('pytest')
session.run('pytest')
def lint(session):
session.install('flake8')
session.run('flake8', '--import-order-style', 'google')

14
tests/test_datatype.py Normal file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env python3
import unittest
import pyFroniusReg.froniusreg as froniusreg
class TestDataTypes(unittest.testCase):
def test_int16(self):
assert froniusreg.int16.decode(froniusreg.int16.encode(65536)) == 65535
if __name__ == '__main__':
unittest.main()