adding basic tests for smbus

This commit is contained in:
Simon Albinsson
2018-04-12 19:49:43 +00:00
parent 65317ef504
commit 9ec514ff92
2 changed files with 35 additions and 0 deletions

11
tests/test_sgp.py Normal file
View File

@@ -0,0 +1,11 @@
from .context import sgp30
from mock_smbus2 import MockSMBus
import unittest
class BasicTestSuite(unittest.TestCase):
"""Basic test cases."""
def setUp(self):
self.bus = MockSMBus()
def test_init(self):
b=sgp30.sgp30.Sgp30(self.bus)
b.init_sgp()