Commit 06c591af4775955de9a23fcf35bfd265db86d71b
1 parent
9b05546a
tests: Move constants into proper module
Showing
2 changed files
with
17 additions
and
10 deletions
tests/test_utils/__init__.py
| 1 | -from os.path import dirname, join, abspath | ||
| 2 | - | ||
| 3 | -# Base dir of project, contains subdirs "tests" and "oletools" and README.md | ||
| 4 | -PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__)))) | ||
| 5 | - | ||
| 6 | -# Directory with test data, independent of current working directory | ||
| 7 | -DATA_BASE_DIR = join(PROJECT_ROOT, 'tests', 'test-data') | ||
| 8 | - | ||
| 9 | -# Directory with source code | ||
| 10 | -SOURCE_BASE_DIR = join(PROJECT_ROOT, 'oletools') | 1 | +from .utils import * |
tests/test_utils/utils.py
0 → 100644
| 1 | +#!/usr/bin/env python3 | ||
| 2 | + | ||
| 3 | +"""Utils generally useful for unittests.""" | ||
| 4 | + | ||
| 5 | +import os | ||
| 6 | +from os.path import dirname, join, abspath | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +# Base dir of project, contains subdirs "tests" and "oletools" and README.md | ||
| 10 | +PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__)))) | ||
| 11 | + | ||
| 12 | +# Directory with test data, independent of current working directory | ||
| 13 | +DATA_BASE_DIR = join(PROJECT_ROOT, 'tests', 'test-data') | ||
| 14 | + | ||
| 15 | +# Directory with source code | ||
| 16 | +SOURCE_BASE_DIR = join(PROJECT_ROOT, 'oletools') |