Test cleanup and fixes

remotes/origin/extra-event-options
Phil Howard 2019-10-10 15:52:43 +01:00
parent d64f7ba650
commit b23b666a34
3 changed files with 11 additions and 12 deletions

View File

@ -6,7 +6,6 @@ from mopidy import core
import pykka
from.pinconfig import PinConfig
logger = logging.getLogger(__name__)
@ -27,9 +26,6 @@ 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

View File

@ -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")
}
}

View File

@ -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