adds tests for crc

This commit is contained in:
Simon Albinsson
2018-04-12 15:32:43 +00:00
parent d4dc8220f7
commit ceb161c6a8
5 changed files with 20 additions and 0 deletions

10
tests/test_crc.py Normal file
View File

@@ -0,0 +1,10 @@
from .context import sgp30
import unittest
class BasicTestSuite(unittest.TestCase):
"""Basic test cases."""
def test_absolute_truth_and_meaning(self):
self.assertEqual(sgp30.Crc8().hash([0xBE, 0xEF]), 0x92,"testing doccumentation example")
self.assertEqual(sgp30.Crc8().hash([1,144]), 76, "First half of default reading")
self.assertEqual(sgp30.Crc8().hash([0,6]), 39, "second half of default reading, ")