Skip to content

Commit

Permalink
Prerelease checks for v0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Sep 9, 2019
1 parent 53a3aab commit fa59426
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ check:
@echo "Checking for trailing whitespace"
@! grep -IUrn --color "[[:blank:]]$$" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO
@echo "Checking for DOS line-endings"
@! grep -IUrn --color "" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
@! grep -IUrnl --color "" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.vscode --exclude-dir=.git --exclude=Makefile
@echo "Checking library/CHANGELOG.txt"
@cat library/CHANGELOG.txt | grep ^${LIBRARY_VERSION}
@echo "Checking library/${LIBRARY_NAME}/__init__.py"
Expand Down
2 changes: 1 addition & 1 deletion examples/ltr559.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def _decode(self, value):
ltr559.set('ALS_MEAS_RATE',
integration_time_ms=50,
repeat_rate_ms=50)

als_meas_rate = ltr559.get('ALS_MEAS_RATE')
assert als_meas_rate.integration_time_ms == 50
assert als_meas_rate.repeat_rate_ms == 50
Expand Down
66 changes: 33 additions & 33 deletions library/tests/test_set_and_get.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
from i2cdevice import MockSMBus, Device, Register, BitField


def test_set_regs():
bus = MockSMBus(1)
device = Device(0x00, i2c_dev=bus, registers=(
Register('test', 0x00, fields=(
BitField('test', 0xFF),
)),
))
device.set('test', test=123)

assert device.get('test').test == 123

assert bus.regs[0] == 123


def test_get_regs():
bus = MockSMBus(1)
device = Device(0x00, i2c_dev=bus, registers=(
Register('test', 0x00, fields=(
BitField('test', 0xFF00),
BitField('monkey', 0x00FF),
), bit_width=16),
))
device.set('test', test=0x66, monkey=0x77)

reg = device.get('test')
reg.test == 0x66
reg.monkey == 0x77

assert bus.regs[0] == 0x66
assert bus.regs[1] == 0x77
from i2cdevice import MockSMBus, Device, Register, BitField


def test_set_regs():
bus = MockSMBus(1)
device = Device(0x00, i2c_dev=bus, registers=(
Register('test', 0x00, fields=(
BitField('test', 0xFF),
)),
))
device.set('test', test=123)

assert device.get('test').test == 123

assert bus.regs[0] == 123


def test_get_regs():
bus = MockSMBus(1)
device = Device(0x00, i2c_dev=bus, registers=(
Register('test', 0x00, fields=(
BitField('test', 0xFF00),
BitField('monkey', 0x00FF),
), bit_width=16),
))
device.set('test', test=0x66, monkey=0x77)

reg = device.get('test')
reg.test == 0x66
reg.monkey == 0x77

assert bus.regs[0] == 0x66
assert bus.regs[1] == 0x77

0 comments on commit fa59426

Please sign in to comment.