-import sys
-import mock
-from i2cdevice import MockSMBus
-
-
-class SMBusFakeDevice(MockSMBus):
- def __init__(self, i2c_bus):
- MockSMBus.__init__(self, i2c_bus)
- self.regs[0x00:0x01] = 0x0f, 0x00
-
-
-def test_gas_setup():
- sys.modules['RPi'] = mock.Mock()
- sys.modules['RPi.GPIO'] = mock.Mock()
- smbus = mock.Mock()
- smbus.SMBus = SMBusFakeDevice
- sys.modules['smbus'] = smbus