Skip to content

Commit 93c0b03

Browse files
committed
Fixup tests, fix linting errors
1 parent 6f57b16 commit 93c0b03

File tree

6 files changed

+49
-40
lines changed

6 files changed

+49
-40
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Python Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python: [2.7, 3.6, 3.7, 3.8]
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python ${{ matrix.python }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python }}
22+
- name: Install Dependencies
23+
run: |
24+
python -m pip install --upgrade setuptools tox
25+
- name: Run Tests
26+
working-directory: library
27+
run: |
28+
tox -e py
29+
- name: Coverage
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
working-directory: library
33+
run: |
34+
python -m pip install coveralls
35+
coveralls --service=github
36+
if: ${{ matrix.python == '3.8' }}

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

library/mics6814/__init__.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
import atexit
21
import ioexpander as io
32

43

54
__version__ = '0.0.1'
65

76
MICS6814_I2C_ADDR = 0x19
87

9-
MICS6814_LED_R = 3 # P1.2
10-
MICS6814_LED_G = 7 # P1.1
11-
MICS6814_LED_B = 2 # P1.0
8+
MICS6814_LED_R = 3 # P1.2
9+
MICS6814_LED_G = 7 # P1.1
10+
MICS6814_LED_B = 2 # P1.0
1211

13-
MICS6814_VREF = 14 # P1.4 AIN0 - 3v3
14-
MICS6814_RED = 12 # P0.5 AIN4 - Reducing
15-
MICS6814_NH3 = 11 # P0.6 AIN3 - NH3
16-
MICS6814_OX = 13 # P0.7 AIN2 - Oxidizing
12+
MICS6814_VREF = 14 # P1.4 AIN0 - 3v3
13+
MICS6814_RED = 12 # P0.5 AIN4 - Reducing
14+
MICS6814_NH3 = 11 # P0.6 AIN3 - NH3
15+
MICS6814_OX = 13 # P0.7 AIN2 - Oxidizing
1716

18-
MICS6814_HEATER_EN = 1 # P1.5 Heater Enable
17+
MICS6814_HEATER_EN = 1 # P1.5 Heater Enable
1918

2019

2120
class Mics6814Reading(object):

library/tests/test_io.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
import mock
32

43

@@ -30,7 +29,7 @@ def test_get_raw_ref(ioexpander):
3029
mics6814 = MICS6814()
3130

3231
mics6814.get_raw_ref()
33-
mics6814._ioe.input.assert_called_with(9)
32+
mics6814._ioe.input.assert_called_with(14)
3433

3534

3635
def test_get_raw_red(ioexpander):

library/tests/test_setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ def test_setup(ioexpander):
66

77
mics6814 = MICS6814()
88

9-
mics6814._ioe.set_pwm_period.assert_called_once_with(255)
9+
mics6814._ioe.set_pwm_period.assert_called_once_with(5100)
1010
mics6814._ioe.set_mode.assert_has_calls((
1111
mock.call(3, ioexpander.PWM),
1212
mock.call(7, ioexpander.PWM),
1313
mock.call(2, ioexpander.PWM),
1414

15-
mock.call(9, ioexpander.ADC),
15+
mock.call(14, ioexpander.ADC),
1616
mock.call(12, ioexpander.ADC),
1717
mock.call(11, ioexpander.ADC),
1818
mock.call(13, ioexpander.ADC),

library/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{27,35,37},qa
2+
envlist = py{27,36,37,38},qa
33
skip_missing_interpreters = True
44

55
[testenv]
@@ -14,7 +14,7 @@ deps =
1414

1515
[testenv:qa]
1616
commands =
17-
check-manifest --ignore tox.ini,tests*,.coveragerc
17+
check-manifest --ignore tox.ini,tests/*,.coveragerc
1818
python setup.py sdist bdist_wheel
1919
twine check dist/*
2020
flake8 --ignore E501

0 commit comments

Comments
 (0)