Skip to content

Commit 88097c2

Browse files
authored
Fix JWT test (#648)
* Fix JWT test * Delete contents but not directory * Don't delete anything * Fix test * Remove unneeded test * Try moving teardown one level up
1 parent 78a6525 commit 88097c2

File tree

4 files changed

+7
-67
lines changed

4 files changed

+7
-67
lines changed

tests/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,9 @@ def __init__(self, name: Optional[str] = None) -> None:
130130
if name != import_name:
131131
dbman.rename_database(os.path.join(self.path, "name.txt"), self.name)
132132
WebDbManager.__init__(self, self.name)
133+
134+
135+
def tearDownModule():
136+
"""Test module tear down."""
137+
if TEST_GRAMPSHOME and os.path.isdir(TEST_GRAMPSHOME):
138+
shutil.rmtree(TEST_GRAMPSHOME)

tests/test_endpoints/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,3 @@ def setUpModule():
122122
"tags": db_state.db.get_number_of_tags(),
123123
}
124124
db_state.db.close()
125-
126-
127-
def tearDownModule():
128-
"""Test module tear down."""
129-
if TEST_GRAMPSHOME and os.path.isdir(TEST_GRAMPSHOME):
130-
shutil.rmtree(TEST_GRAMPSHOME)

tests/test_init.py

Lines changed: 0 additions & 60 deletions
This file was deleted.

tests/test_jwt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _add_person(gender, first_name, surname, trans, db, private=False):
5252
class TestPerson(unittest.TestCase):
5353
@classmethod
5454
def setUpClass(cls):
55-
cls.name = "Test Web API"
55+
cls.name = "Test Web API test_jwt"
5656
cls.dbman = CLIDbManager(DbState())
5757
_, _name = cls.dbman.create_new_db_cli(cls.name, dbid="sqlite")
5858
with patch.dict("os.environ", {ENV_CONFIG_FILE: TEST_AUTH_CONFIG}):

0 commit comments

Comments
 (0)