mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
xprocess expects PHP to have decent performance
This commit is contained in:
parent
7bc6c41164
commit
cb3255715a
1 changed files with 16 additions and 1 deletions
|
|
@ -9,16 +9,31 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
import requests
|
||||||
|
import requests.exceptions
|
||||||
|
import time
|
||||||
|
|
||||||
dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale_filesystem'
|
dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale_filesystem'
|
||||||
php_sh = os.path.abspath(os.path.join(
|
php_sh = os.path.abspath(os.path.join(
|
||||||
os.path.dirname(__file__), '../../../owncloud-testserver/php.sh'
|
os.path.dirname(__file__), '../../../owncloud-testserver/php.sh'
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
def wait():
|
||||||
|
for i in range(10):
|
||||||
|
try:
|
||||||
|
requests.get('http://127.0.0.1:8080/')
|
||||||
|
except requests.exceptions.HTTPException:
|
||||||
|
time.sleep(1)
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
if dav_server == 'owncloud':
|
if dav_server == 'owncloud':
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def start_owncloud_server(xprocess):
|
def start_owncloud_server(xprocess):
|
||||||
def preparefunc(cwd):
|
def preparefunc(cwd):
|
||||||
return 'Listening on', ['sh', php_sh]
|
return wait, ['sh', php_sh]
|
||||||
|
|
||||||
xprocess.ensure('owncloud_server', preparefunc)
|
xprocess.ensure('owncloud_server', preparefunc)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue