Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[offline editing] Wait for the WFS server to stop
  • Loading branch information
elpaso committed Jul 12, 2016
1 parent b5c0bc9 commit b5f02e3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/src/python/test_offline_editing_wfs.py
Expand Up @@ -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,
Expand All @@ -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()


Expand Down Expand Up @@ -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()

Expand All @@ -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()
Expand Down

0 comments on commit b5f02e3

Please sign in to comment.