diff --git a/GreenPonik_BME280/tests/test_GreenPonik_BME280.py b/GreenPonik_BME280/tests/test_GreenPonik_BME280.py index 2427d0c..870e5eb 100644 --- a/GreenPonik_BME280/tests/test_GreenPonik_BME280.py +++ b/GreenPonik_BME280/tests/test_GreenPonik_BME280.py @@ -4,34 +4,29 @@ import sys import unittest -from unittest.mock import patch, MagicMock +from unittest.mock import patch -class BoardMock: - def __init__(self): - self._scl = 18 - self._sda = 15 - - def SCL(self): - return self._scl +class SmbusMock(): + pass - def SDA(self): - return self._sda +class FCNTLMock: + def __init__(self): + pass -class BusioMock(MagicMock()): - def I2C(self, sda, scl): - return True + def ioctl(): + pass -sys.modules["board"] = BoardMock() -sys.modules["busio"] = BusioMock() +sys.modules["fcntl"] = FCNTLMock() +sys.modules["smbus"] = SmbusMock() class Test_GreenPonik_BME280(unittest.TestCase): @patch("GreenPonik_BME280.GreenPonik_BME280") - def test_read_bme280(self, MockBME): - bme = MockBME() + def test_read_bme280(self, Mock): + bme = Mock() expected = [21.8, 62.3, 1014.5, 426.37] bme.read_bme280.return_value = expected readed = bme.read_bme280() diff --git a/setup.py b/setup.py index c83841b..e53c653 100644 --- a/setup.py +++ b/setup.py @@ -9,14 +9,14 @@ EMAIL = "contact@greenponik.com" AUTHOR = "GreenPonik SAS" REQUIRES_PYTHON = ">=3.6.0" -VERSION = "0.0.1" +VERSION = "0.0.2" # What packages are required for this module to be executed? REQUIRED = [ # 'requests', 'maya', 'records', 'adafruit-blinka', 'adafruit-circuitpython-bme280', - 'adafruit-extended-bus==1.0.0', + 'adafruit-extended-bus', ] # What packages are optional? diff --git a/version.py b/version.py index 5f284fc..e62b38a 100644 --- a/version.py +++ b/version.py @@ -1,2 +1,2 @@ -__version__ = "0.0.1" +__version__ = "0.0.2"