-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #684 from gschwind/pr-sanitize-tests
Sanitize tests suite
- Loading branch information
Showing
31 changed files
with
530 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[pytest] | ||
addopts = --import-mode=importlib | ||
pythonpath = tests | ||
testpaths = tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# coding=utf-8 | ||
import os | ||
import unittest | ||
import pywps.configuration | ||
from tempfile import TemporaryDirectory | ||
|
||
|
||
class TestBase(unittest.TestCase): | ||
|
||
def setUp(self) -> None: | ||
# Do not use load_configuration() that will load system configuration | ||
# files such as /etc/pywps.cfg | ||
pywps.configuration.load_hardcoded_configuration() | ||
|
||
# Ensure all data goes into ontime temporary directory | ||
self.tmpdir = TemporaryDirectory(prefix="pywps_test_") | ||
|
||
# shortcut | ||
set = pywps.configuration.CONFIG.set | ||
|
||
set('server', 'temp_path', f"{self.tmpdir.name}/temp_path") | ||
set('server', 'outputpath', f"{self.tmpdir.name}/outputpath") | ||
set('server', 'workdir', f"{self.tmpdir.name}/workdir") | ||
|
||
set('logging', 'level', 'DEBUG') | ||
set('logging', 'file', f"{self.tmpdir.name}/logging-file.log") | ||
set("logging", "database", f"sqlite:///{self.tmpdir.name}/test-pywps-logs.sqlite3") | ||
|
||
set('processing', 'path', f"{self.tmpdir.name}/processing_path") | ||
|
||
os.mkdir(f"{self.tmpdir.name}/temp_path") | ||
os.mkdir(f"{self.tmpdir.name}/outputpath") | ||
os.mkdir(f"{self.tmpdir.name}/workdir") | ||
os.mkdir(f"{self.tmpdir.name}/processing_path") | ||
|
||
def tearDown(self) -> None: | ||
self.tmpdir.cleanup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.