Skip to content
Snippets Groups Projects
Commit 94c9e18d authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #10339: try import, skip test if package not available. package mock is...

Task #10339: try import, skip test if package not available. package mock is required for build, just for run.
parent dc490f21
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
include(LofarCTest)
include(FindPythonModule)
find_python_module(mock REQUIRED)
find_python_module(mock)
lofar_add_test(test_momqueryservice)
......@@ -19,11 +19,23 @@
# $Id: $
import unittest
import mock
import testing.mysqld
import uuid
from mysql import connector
try:
import mock
except ImportError as e:
print str(e)
print 'Please install python package mock: sudo apt-get install python-mock'
exit(3) #special lofar test exit code: skipped test
try:
import testing.mysqld
except ImportError as e:
print str(e)
print 'Please install python package testing.mysqld: sudo pip install testing.mysqld'
exit(3) #special lofar test exit code: skipped test
from lofar.common.dbcredentials import Credentials
from lofar.mom.momqueryservice.momqueryrpc import MoMQueryRPC
from lofar.mom.momqueryservice.config import DEFAULT_MOMQUERY_SERVICENAME
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment