Skip to content

Commit

Permalink
refactor(test): tweak so tests can be run in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney authored and robertbartel committed May 6, 2024
1 parent 87e6765 commit 53f5cbf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/lib/scheduler/dmod/test/test_rsa_key_pair.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
import tempfile
from pathlib import Path
from tempfile import TemporaryDirectory
from ..scheduler.rsa_key_pair import RsaKeyPair
Expand All @@ -9,7 +10,8 @@ class TestRsaKeyPair(unittest.TestCase):

def setUp(self) -> None:
self.rsa_key_pairs: Dict[int, RsaKeyPair] = dict()
self.rsa_key_pairs[1] = RsaKeyPair(directory='.', name='id_rsa_1')
self.tempdir = tempfile.TemporaryDirectory()
self.rsa_key_pairs[1] = RsaKeyPair(directory=self.tempdir.name, name='id_rsa_1')

self.serial_rsa_key_pairs: Dict[int, dict] = dict()
self.serial_rsa_key_pairs[1] = self.rsa_key_pairs[1].to_dict()
Expand All @@ -18,6 +20,7 @@ def setUp(self) -> None:
def tearDown(self) -> None:
self.rsa_key_pairs[1].private_key_file.unlink(missing_ok=True)
self.rsa_key_pairs[1].public_key_file.unlink(missing_ok=True)
self.tempdir.cleanup()

def test_generate_key_pair_1_a(self):
"""
Expand Down

0 comments on commit 53f5cbf

Please sign in to comment.