Merge branch 'vici-pytest'
Adds tox.ini to test with tox (which is now used on Travis) and includes the tests in the source distribution.
This commit is contained in:
+3
-1
@@ -1345,6 +1345,7 @@ if test x$python_eggs = xtrue; then
|
||||
else
|
||||
AC_SUBST(PYTHONEGGINSTALLDIR, "--install-dir $pythoneggdir")
|
||||
fi
|
||||
AC_PATH_PROG([TOX], [tox], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
|
||||
AC_PATH_PROG([PY_TEST], [py.test], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
|
||||
fi
|
||||
AM_CONDITIONAL(PYTHON_EGGS_INSTALL, [test "x$python_eggs_install" = xtrue])
|
||||
@@ -1764,7 +1765,8 @@ AM_CONDITIONAL(USE_LEGACY_SYSTEMD, test -n "$systemdsystemunitdir" -a "x$systemd
|
||||
AM_CONDITIONAL(USE_RUBY_GEMS, test x$ruby_gems = xtrue)
|
||||
AM_CONDITIONAL(USE_PYTHON_EGGS, test x$python_eggs = xtrue)
|
||||
AM_CONDITIONAL(USE_PERL_CPAN, test x$perl_cpan = xtrue)
|
||||
AM_CONDITIONAL(USE_PY_TEST, test "x$PY_TEST" != x)
|
||||
AM_CONDITIONAL(USE_TOX, test "x$TOX" != x)
|
||||
AM_CONDITIONAL(USE_PY_TEST, test "x$PY_TEST" != x -a "x$TOX" = x)
|
||||
|
||||
# ========================
|
||||
# set global definitions
|
||||
|
||||
+1
-1
@@ -157,7 +157,7 @@ all|coverage|sonarcloud)
|
||||
libmysqlclient-dev libsqlite3-dev clearsilver-dev libfcgi-dev
|
||||
libpcsclite-dev libpam0g-dev binutils-dev libunwind8-dev libnm-dev
|
||||
libjson-c-dev iptables-dev python-pip libtspi-dev libsystemd-dev"
|
||||
PYDEPS="pytest"
|
||||
PYDEPS="tox"
|
||||
if test "$1" = "deps"; then
|
||||
build_botan
|
||||
build_wolfssl
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.tox
|
||||
*.pyc
|
||||
build
|
||||
dist
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
include LICENSE
|
||||
include README.rst
|
||||
include tox.ini
|
||||
recursive-include test *.py
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
EXTRA_DIST = LICENSE README.rst MANIFEST.in \
|
||||
setup.py.in \
|
||||
vici/test/__init__.py \
|
||||
vici/test/test_protocol.py \
|
||||
tox.ini \
|
||||
tox.sh \
|
||||
test/__init__.py \
|
||||
test/test_protocol.py \
|
||||
vici/__init__.py \
|
||||
vici/command_wrappers.py \
|
||||
vici/compat.py \
|
||||
@@ -37,6 +39,12 @@ install-exec-local: dist/vici-$(PYTHON_PACKAGE_VERSION)-py$(PYTHON_VERSION).egg
|
||||
dist/vici-$(PYTHON_PACKAGE_VERSION)-py$(PYTHON_VERSION).egg
|
||||
endif
|
||||
|
||||
if USE_TOX
|
||||
TESTS_ENVIRONMENT = export TOX=$(TOX);
|
||||
AM_TESTS_FD_REDIRECT = 1>&2
|
||||
TESTS = tox.sh
|
||||
endif
|
||||
|
||||
if USE_PY_TEST
|
||||
TESTS = $(PY_TEST)
|
||||
endif
|
||||
|
||||
@@ -24,6 +24,10 @@ setup(
|
||||
"Programming Language :: Python :: 3.2",
|
||||
"Programming Language :: Python :: 3.3",
|
||||
"Programming Language :: Python :: 3.4",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Topic :: Security",
|
||||
"Topic :: Software Development :: Libraries",
|
||||
)
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from ..protocol import Packet, Message, FiniteStream
|
||||
from ..exception import DeserializationException
|
||||
from vici.protocol import Packet, Message, FiniteStream
|
||||
from vici.exception import DeserializationException
|
||||
|
||||
|
||||
class TestPacket(object):
|
||||
@@ -0,0 +1,16 @@
|
||||
[tox]
|
||||
envlist = py27, py35, py36, py37, py38
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
pytest
|
||||
pytest-pycodestyle
|
||||
commands = pytest --pycodestyle
|
||||
|
||||
[testenv:py27]
|
||||
deps = pytest
|
||||
commands = pytest
|
||||
|
||||
[pycodestyle]
|
||||
max-line-length = 80
|
||||
show-source = True
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
${TOX} -c ${srcdir} --skip-missing-interpreters
|
||||
@@ -232,7 +232,6 @@ class CommandWrappers(object):
|
||||
"""
|
||||
self.request("load-shared", secret)
|
||||
|
||||
|
||||
def unload_shared(self, identifier):
|
||||
"""Unload a previously loaded shared secret by its unique identifier.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user