From d489d2c5b9be9c1c5273707056afbcf34aa7d6f6 Mon Sep 17 00:00:00 2001 From: Paul Warren Date: Wed, 9 Oct 2024 17:08:43 +1100 Subject: [PATCH] Noxfile adjustment, simple test --- noxfile.py | 9 +++++---- tests/test_datatype.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 tests/test_datatype.py diff --git a/noxfile.py b/noxfile.py index bd1e55f..11ac9c5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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') - diff --git a/tests/test_datatype.py b/tests/test_datatype.py new file mode 100644 index 0000000..83e2cb0 --- /dev/null +++ b/tests/test_datatype.py @@ -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() +