From 06c591af4775955de9a23fcf35bfd265db86d71b Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Mon, 29 Apr 2019 13:12:41 +0200 Subject: [PATCH] tests: Move constants into proper module --- tests/test_utils/__init__.py | 11 +---------- tests/test_utils/utils.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 tests/test_utils/utils.py diff --git a/tests/test_utils/__init__.py b/tests/test_utils/__init__.py index 5eda62a..16281fe 100644 --- a/tests/test_utils/__init__.py +++ b/tests/test_utils/__init__.py @@ -1,10 +1 @@ -from os.path import dirname, join, abspath - -# Base dir of project, contains subdirs "tests" and "oletools" and README.md -PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__)))) - -# Directory with test data, independent of current working directory -DATA_BASE_DIR = join(PROJECT_ROOT, 'tests', 'test-data') - -# Directory with source code -SOURCE_BASE_DIR = join(PROJECT_ROOT, 'oletools') +from .utils import * diff --git a/tests/test_utils/utils.py b/tests/test_utils/utils.py new file mode 100644 index 0000000..b3b9005 --- /dev/null +++ b/tests/test_utils/utils.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +"""Utils generally useful for unittests.""" + +import os +from os.path import dirname, join, abspath + + +# Base dir of project, contains subdirs "tests" and "oletools" and README.md +PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__)))) + +# Directory with test data, independent of current working directory +DATA_BASE_DIR = join(PROJECT_ROOT, 'tests', 'test-data') + +# Directory with source code +SOURCE_BASE_DIR = join(PROJECT_ROOT, 'oletools') -- libgit2 0.21.4