Skip to content

Commit

Permalink
correct edition
Browse files Browse the repository at this point in the history
  • Loading branch information
Mickael committed Sep 8, 2020
1 parent 40fed6d commit be79a2b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
29 changes: 12 additions & 17 deletions GreenPonik_BME280/tests/test_GreenPonik_BME280.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
EMAIL = "[email protected]"
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?
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = "0.0.1"
__version__ = "0.0.2"

0 comments on commit be79a2b

Please sign in to comment.