fix tox runs
This commit is contained in:
parent
41b7c27a63
commit
c18823cf88
|
@ -3,6 +3,7 @@ import unittest
|
||||||
|
|
||||||
from aprsd_slack_plugin import location_plugin
|
from aprsd_slack_plugin import location_plugin
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 2):
|
if sys.version_info >= (3, 2):
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
else:
|
else:
|
||||||
|
@ -10,7 +11,7 @@ else:
|
||||||
|
|
||||||
|
|
||||||
class TestPlugin(unittest.TestCase):
|
class TestPlugin(unittest.TestCase):
|
||||||
@mock.patch.object(location_plugin.SlackLocationPlugin, "command")
|
@mock.patch.object(location_plugin.SlackLocationPlugin, "filter")
|
||||||
def test_plugin(self, mock_command):
|
def test_plugin(self, mock_command):
|
||||||
mock_command.return_value = ""
|
mock_command.return_value = ""
|
||||||
|
|
||||||
|
@ -19,4 +20,5 @@ class TestPlugin(unittest.TestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
p = location_plugin.SlackLocationPlugin(config)
|
p = location_plugin.SlackLocationPlugin(config)
|
||||||
p.command("KM6LYW", "location", 1)
|
packet = {"from": "WB4BOR", "message_text": "location"}
|
||||||
|
p.filter(packet)
|
||||||
|
|
12
tox.ini
12
tox.ini
|
@ -32,7 +32,7 @@ isolated_build = true
|
||||||
[testenv]
|
[testenv]
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-requirements.txt
|
-r{toxinidir}/requirements-dev.txt
|
||||||
commands =
|
commands =
|
||||||
# Use -bb to enable BytesWarnings as error to catch str/bytes misuse.
|
# Use -bb to enable BytesWarnings as error to catch str/bytes misuse.
|
||||||
# Use -Werror to treat warnings as errors.
|
# Use -Werror to treat warnings as errors.
|
||||||
|
@ -42,14 +42,14 @@ commands =
|
||||||
skip_install = true
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-requirements.txt
|
-r{toxinidir}/requirements-dev.txt
|
||||||
commands =
|
commands =
|
||||||
mypy src tests
|
mypy src tests
|
||||||
|
|
||||||
[testenv:lint]
|
[testenv:lint]
|
||||||
skip_install = true
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/dev-requirements.txt
|
-r{toxinidir}/requirements-dev.txt
|
||||||
commands =
|
commands =
|
||||||
flake8 aprsd_slack_plugin tests
|
flake8 aprsd_slack_plugin tests
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ commands =
|
||||||
skip_install = true
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-requirements.txt
|
-r{toxinidir}/requirements-dev.txt
|
||||||
changedir = {toxinidir}/docs
|
changedir = {toxinidir}/docs
|
||||||
commands =
|
commands =
|
||||||
{envpython} clean_docs.py
|
{envpython} clean_docs.py
|
||||||
|
@ -67,7 +67,7 @@ commands =
|
||||||
[testenv:fmt]
|
[testenv:fmt]
|
||||||
skip_install = true
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/dev-requirements.txt
|
-r{toxinidir}/requirements-dev.txt
|
||||||
commands =
|
commands =
|
||||||
isort aprsd_slack_plugin tests
|
isort aprsd_slack_plugin tests
|
||||||
black aprsd_slack_plugin tests
|
black aprsd_slack_plugin tests
|
||||||
|
@ -75,7 +75,7 @@ commands =
|
||||||
[testenv:fmt-check]
|
[testenv:fmt-check]
|
||||||
skip_install = true
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/dev-requirements.txt
|
-r{toxinidir}/requirements-dev.txt
|
||||||
commands =
|
commands =
|
||||||
isort --check-only aprsd_slack_plugin tests
|
isort --check-only aprsd_slack_plugin tests
|
||||||
black --check aprsd_slack_plugin tests
|
black --check aprsd_slack_plugin tests
|
||||||
|
|
Loading…
Reference in New Issue