Test cleanup and fixes
parent
d64f7ba650
commit
b23b666a34
|
@ -6,7 +6,6 @@ from mopidy import core
|
|||
|
||||
import pykka
|
||||
|
||||
from.pinconfig import PinConfig
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -27,13 +26,10 @@ class RaspberryGPIOFrontend(pykka.ThreadingActor, core.CoreListener):
|
|||
for key in self.config:
|
||||
if key.startswith("bcm"):
|
||||
pin = int(key.replace("bcm", ""))
|
||||
# settings = PinConfig().deserialize(
|
||||
# self.config[key]
|
||||
# )
|
||||
settings = self.config[key]
|
||||
if settings is None:
|
||||
continue
|
||||
|
||||
|
||||
pull = GPIO.PUD_UP
|
||||
edge = GPIO.FALLING
|
||||
if settings.active == 'active_high':
|
||||
|
|
|
@ -6,12 +6,16 @@ import mock
|
|||
|
||||
import pytest
|
||||
|
||||
from mopidy_raspberry_gpio import Extension, frontend as frontend_lib
|
||||
from mopidy_raspberry_gpio import Extension, pinconfig
|
||||
from mopidy_raspberry_gpio import frontend as frontend_lib
|
||||
|
||||
|
||||
deserialize = pinconfig.PinConfig().deserialize
|
||||
|
||||
dummy_config = {
|
||||
"raspberry-gpio": {
|
||||
"bcm1": "play_pause,active_low,30"
|
||||
# Plugins expect settings to be deserialized
|
||||
"bcm1": deserialize("play_pause,active_low,30")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
9
tox.ini
9
tox.ini
|
@ -1,5 +1,5 @@
|
|||
[tox]
|
||||
envlist = py27, flake8, check-manifest
|
||||
envlist = py27, py27-flake8, py27-check-manifest
|
||||
|
||||
[testenv]
|
||||
sitepackages = true
|
||||
|
@ -15,14 +15,13 @@ commands =
|
|||
--cov=mopidy_raspberry_gpio --cov-report=term-missing \
|
||||
{posargs}
|
||||
|
||||
[testenv:flake8]
|
||||
[testenv:py27-flake8]
|
||||
deps =
|
||||
flake8
|
||||
flake8-import-order
|
||||
skip_install = true
|
||||
commands = python -m flake8
|
||||
|
||||
[testenv:check-manifest]
|
||||
[testenv:py27-check-manifest]
|
||||
deps = check-manifest
|
||||
skip_install = true
|
||||
commands = python -m check-manifest
|
||||
commands = check-manifest
|
||||
|
|
Loading…
Reference in New Issue