Skip to content
Permalink
Browse files

[offline editing] Wait for the WFS server to stop

  • Loading branch information
elpaso committed Jul 12, 2016
1 parent b5c0bc9 commit b5f02e3d25db14c8f90bbdc670c556cf5ae23cda
Showing with 4 additions and 7 deletions.
  1. +4 −7 tests/src/python/test_offline_editing_wfs.py
@@ -36,10 +36,7 @@
import tempfile
from time import sleep
from utilities import unitTestDataPath
from qgis.core import (
QgsVectorLayer,
QgsProject,
)
from qgis.core import QgsVectorLayer

from qgis.testing import (
start_app,
@@ -48,14 +45,11 @@

from offlineditingtestbase import OfflineTestBase

from qgis.PyQt.QtCore import QFileInfo

try:
QGIS_SERVER_WFST_DEFAULT_PORT = os.environ['QGIS_SERVER_WFST_DEFAULT_PORT']
except:
QGIS_SERVER_WFST_DEFAULT_PORT = 8081


qgis_app = start_app()


@@ -99,6 +93,7 @@ def setUp(self):
"""Run before each test."""
self.server = subprocess.Popen([sys.executable, self.server_path],
env=os.environ)
# Wait for the server process to start
sleep(2)
self._setUp()

@@ -109,6 +104,8 @@ def tearDown(self):
# Kill the server
self.server.terminate()
del self.server
# Wait for the server process to stop
sleep(2)
# Delete the sqlite db
os.unlink(os.path.join(self.temp_path, 'offlineDbFile.sqlite'))
self._tearDown()

0 comments on commit b5f02e3

Please sign in to comment.
You can’t perform that action at this time.