Skip to content

Commit

Permalink
Merge branch 'test_folders' into sea_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scossu committed Dec 11, 2024
2 parents aeb13fc + 03c0fcd commit 81182e4
Show file tree
Hide file tree
Showing 31 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sscli
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ from os import path

from scriptshifter import DB_PATH
from scriptshifter.tables import init_db as _init_db
from tests.integration_tests import test_sample
from test.integration import test_sample


@click.group()
Expand Down
5 changes: 5 additions & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from os import path


TEST_DIR = path.dirname(path.realpath(__file__))
TEST_DATA_DIR = path.join(TEST_DIR, "data")
Empty file added test/data/log/.keep
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/integration_tests.py → test/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from os import path

from scriptshifter.trans import transliterate
from tests import TEST_DATA_DIR
from test import TEST_DATA_DIR

logger = getLogger(__name__)

Expand Down
7 changes: 3 additions & 4 deletions tests/__init__.py → test/unittest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
from scriptshifter import tables


TEST_DIR = path.dirname(path.realpath(__file__))
TEST_DATA_DIR = path.join(TEST_DIR, "data")
TEST_CONFIG_DIR = path.join(TEST_DIR, "tables", "data")
UNITTEST_CONFIG_DIR = path.join(
path.dirname(path.realpath(__file__)), "tables", "data")

# Reload main SS modules after changing environment variables.
environ["TXL_DB_PATH"] = path.join(gettempdir(), "scriptshifter_unittest.db")
reload(scriptshifter)
environ["TXL_CONFIG_TABLE_DIR"] = TEST_CONFIG_DIR
environ["TXL_CONFIG_TABLE_DIR"] = UNITTEST_CONFIG_DIR
reload(tables)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from scriptshifter.trans import transliterate
from scriptshifter.tables import get_language, init_db
from tests import TEST_DATA_DIR
from test import TEST_DATA_DIR


logger = logging.getLogger(__name__)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 81182e4

Please sign in to comment.