mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Framework: provide test and style-python targets
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2015-2017 Franco Fichtner <franco@opnsense.org>
|
||||
# Copyright (c) 2015-2018 Franco Fichtner <franco@opnsense.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
@@ -42,7 +42,7 @@ list:
|
||||
.endfor
|
||||
|
||||
# shared targets that are sane to run from the root directory
|
||||
TARGETS= lint sweep style style-fix clean
|
||||
TARGETS= clean lint style style-fix style-python sweep test
|
||||
|
||||
.for TARGET in ${TARGETS}
|
||||
${TARGET}:
|
||||
|
||||
@@ -312,4 +312,16 @@ style-fix: check
|
||||
fi
|
||||
.endfor
|
||||
|
||||
style-python: check
|
||||
@if [ -d ${.CURDIR}/src ]; then \
|
||||
pycodestyle --ignore=E501 ${.CURDIR}/src || true; \
|
||||
fi
|
||||
|
||||
test: check
|
||||
@if [ -d ${.CURDIR}/src/opnsense/mvc/tests ]; then \
|
||||
cd /usr/local/opnsense/mvc/tests && \
|
||||
phpunit --configuration PHPunit.xml \
|
||||
${.CURDIR}/src/opnsense/mvc/tests; \
|
||||
fi
|
||||
|
||||
.PHONY: check
|
||||
|
||||
@@ -57,7 +57,7 @@ if os.path.exists(hello_world_config):
|
||||
result['message'] = 'test ok!'
|
||||
except smtplib.SMTPException as error:
|
||||
# unable to send mail
|
||||
result['message'] = '%s'%error
|
||||
result['message'] = '%s' % error
|
||||
except socket.error as error:
|
||||
# connect error
|
||||
if error.strerror is None:
|
||||
|
||||
Reference in New Issue
Block a user