Skip to content
Snippets Groups Projects
Commit 6b87e5e0 authored by Antoine Martin's avatar Antoine Martin Committed by omni
Browse files

community/py3-webdavclient3: enable tests

parent 1a7297a7
No related branches found
No related tags found
1 merge request!64668community/py3-webdavclient3: move from testing, enable tests
Pipeline #232107 skipped
......@@ -10,12 +10,19 @@ url="https://pypi.python.org/project/webdavclient3"
arch="noarch"
license="MIT"
depends="py3-requests py3-lxml py3-dateutil"
checkdepends="py3-pytest"
checkdepends="
py3-pytest
nginx
nginx-mod-http-dav-ext
"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="$pkgname-$pkgver.tar.gz::https://github.com/ezhov-evgeny/webdav-client-python-3/archive/refs/tags/v$pkgver.tar.gz"
source="
$pkgname-$pkgver.tar.gz::https://github.com/ezhov-evgeny/webdav-client-python-3/archive/refs/tags/v$pkgver.tar.gz
nginx-test.conf
nginx-user.conf
"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"
options="!check" # Test suite needs more work to be setup to work in aports env
build() {
gpep517 build-wheel \
......@@ -24,9 +31,19 @@ build() {
}
check() {
nginx -c "$srcdir"/nginx-test.conf &
mkdir -p /tmp/www
python3 -m venv --clear --without-pip --system-site-packages .testenv
.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
.testenv/bin/python3 -m pytest -v
# set and get property disabled due to nginx-dav-ext-module not supporting PROPPATCH
# see https://github.com/arut/nginx-dav-ext-module/pull/64
# upstream uses apache2 for test server, which can't run as normal user
.testenv/bin/python3 -m pytest -v -k 'not test_get_property and not test_set_property' || local FAIL=true
pkill nginx
rm -R /tmp/www
if [ "$FAIL" = "true" ]; then
return 1
fi
}
package() {
......@@ -36,4 +53,6 @@ package() {
sha512sums="
4621dfe3fdde4a60a7580b37aaf2bf778ebae1615946e9ff5aedcf3d2d17b3e60511a4522f8023bd4756139c66027149a2afafbd07bf02d029d811bec172057d py3-webdavclient3-3.14.6.tar.gz
94fc0ca132eb3f96b613a8bc4788ff8ce4d9f06b7576d13a5bbd4a2994684d6087da791b258aac45ecaca3224a98c34d2853026ead24774901dc9ac8f0763dbb nginx-test.conf
c0f9b9558abc0809fbf5e7600ba9f868f491debb7405bb5595ecfcc300cb68c602d2efe4340f1c86367f2ba7449b7f725affb9575a8b08bb5f9b65119f297a88 nginx-user.conf
"
pid /tmp/nginx.pid;
error_log stderr;
worker_processes 1;
daemon off;
load_module "/usr/lib/nginx/modules/ngx_http_dav_ext_module.so";
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
dav_ext_lock_zone zone=foo:10m;
sendfile on;
keepalive_timeout 65;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
access_log /tmp/access.log;
error_log /tmp/error.log;
proxy_temp_path /tmp/proxy_temp_path;
client_body_temp_path /tmp/client_body_temp_path/;
fastcgi_temp_path /tmp/fastcgi_temp_path;
uwsgi_temp_path /tmp/uwsgi_temp_path;
scgi_temp_path /tmp/scgi_temp_path;
server {
listen 8585 default_server;
listen [::]:8585 default_server;
root /tmp/www/;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
autoindex on;
if (-d $request_filename) { rewrite ^(.*[^/])$ $1/ break; }
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;
dav_ext_lock zone=foo;
dav_access user:rw group:rw all:rw;
# enable creating directories without trailing slash
set $x $uri$request_method;
if ($x ~ [^/]MKCOL$) {
rewrite ^(.*)$ $1/;
}
client_max_body_size 0;
create_full_put_path on;
client_body_temp_path /tmp/client_body_temp_path;
auth_basic "Restricted Access";
auth_basic_user_file ./nginx-user.conf;
}
}
}
alice:$apr1$D8rOJ90Z$9DjYGFgSrkZnyNMH13qvD/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment