diff --git a/tests/test-pywps.cfg b/tests/test-pywps.cfg index b724583a8..e071d0756 100644 --- a/tests/test-pywps.cfg +++ b/tests/test-pywps.cfg @@ -1,3 +1,6 @@ +[server] +language=en-US,fr-CA + [logging] level=INFO file=/tmp/pywps-test.log diff --git a/tests/test_capabilities.py b/tests/test_capabilities.py index 1527aa622..98dc8bfe8 100644 --- a/tests/test_capabilities.py +++ b/tests/test_capabilities.py @@ -6,7 +6,7 @@ import unittest import lxml import lxml.etree -from pywps.configuration import CONFIG +from pywps import configuration from pywps.app import Process, Service from pywps.app.Common import Metadata from pywps import get_ElementMakerForVersion @@ -139,7 +139,8 @@ def test_version2(self): class CapabilitiesTranslationsTest(unittest.TestCase): def setUp(self): - CONFIG.set('server', 'language', 'en-US,fr-CA') + configuration.load_configuration() + configuration.CONFIG.set('server', 'language', 'en-US,fr-CA') self.client = client_for( Service( processes=[ @@ -162,7 +163,7 @@ def setUp(self): ) def tearDown(self): - CONFIG.set('server', 'language', 'en-US') + configuration.CONFIG.set('server', 'language', 'en-US') def test_get_translated(self): resp = self.client.get('?Request=GetCapabilities&service=wps&language=fr-CA') diff --git a/tests/test_describe.py b/tests/test_describe.py index bca5984fb..047aec1a8 100644 --- a/tests/test_describe.py +++ b/tests/test_describe.py @@ -13,7 +13,7 @@ from pywps.app.Common import Metadata from pywps.inout.literaltypes import AllowedValue from pywps.validator.allowed_value import ALLOWEDVALUETYPE -from pywps.configuration import CONFIG +from pywps import configuration from pywps.tests import assert_pywps_version, client_for @@ -141,7 +141,8 @@ def test_post_two_args(self): class DescribeProcessTranslationsTest(unittest.TestCase): def setUp(self): - CONFIG.set('server', 'language', 'en-US,fr-CA') + configuration.get_config_value('server', 'language') + configuration.CONFIG.set('server', 'language', 'en-US,fr-CA') self.client = client_for( Service( processes=[ @@ -196,7 +197,7 @@ def setUp(self): ) def tearDown(self): - CONFIG.set('server', 'language', 'en-US') + configuration.CONFIG.set('server', 'language', 'en-US') def test_get_describe_translations(self): resp = self.client.get('?Request=DescribeProcess&service=wps&version=1.0.0&identifier=all&language=fr-CA') diff --git a/tests/test_execute.py b/tests/test_execute.py index fc6d20bab..e1f017768 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -19,7 +19,7 @@ from pywps.app.basic import get_xpath_ns from pywps._compat import text_type from pywps.tests import client_for, assert_response_success -from pywps.configuration import CONFIG +from pywps import configuration from pywps._compat import PY2 from pywps._compat import StringIO @@ -503,10 +503,11 @@ def test_output_response_dataType(self): class ExecuteTranslationsTest(unittest.TestCase): def setUp(self): - CONFIG.set('server', 'language', 'en-US,fr-CA') + configuration.get_config_value('server', 'language') + configuration.CONFIG.set('server', 'language', 'en-US,fr-CA') def tearDown(self): - CONFIG.set('server', 'language', 'en-US') + configuration.CONFIG.set('server', 'language', 'en-US') def test_translations(self): client = client_for(Service(processes=[create_translated_greeter()]))