Mercurial > hgrepos > Python > libs > data-schema
annotate tests/_config.py @ 16:2a9e7c4b717e
Problem severity now is also an enum
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 07 Jul 2023 02:33:28 +0200 |
| parents | 84dfd1a94926 |
| children |
| rev | line source |
|---|---|
|
5
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
1 r"""Common configuration for unittests. |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
2 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
3 Importing changes PYTHONPATH as a side-effect: be able to import data_schema |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
4 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
5 """ |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
6 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
7 import sys |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
8 import os |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
9 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
10 import configmix.config |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
11 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
12 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
13 PROJECTDIR = os.path.abspath(os.path.join( |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
14 os.path.dirname(__file__), "..")) |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
15 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
16 FILEURI_PREFIX = "file:/tests/schemata/" |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
17 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
18 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
19 # |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
20 # Side effects |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
21 # |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
22 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
23 # Allow to import the vlobby package |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
24 sys.path.append(PROJECTDIR) |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
25 |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
26 # Also synthesize a minimal configuration just valid for the unittests |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
27 config = configmix.config.Configuration( |
|
84dfd1a94926
Add the existing implementation.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
28 projectdir=PROJECTDIR) |
