Skip to content

Commit

Permalink
tests(slurm_ops): fix tests on py310 by explicitly mocking `_keyfile_…
Browse files Browse the repository at this point in the history
…path`

Signed-off-by: Jason C. Nucciarone <[email protected]>
  • Loading branch information
NucciTheBoss committed Oct 1, 2024
1 parent 2326c69 commit 704777d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/unit/test_slurm_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import base64
import subprocess
import textwrap
from pathlib import Path
from unittest import TestCase
from unittest.mock import patch

Expand Down Expand Up @@ -160,9 +161,11 @@ class SlurmOpsBase:
def setUp(self):
self.setUpPyfakefs()
self.fs.create_file("/var/snap/slurm/common/.env")
self.fs.create_file(
"/var/snap/slurm/common/var/lib/slurm/slurm.state/jwt_hs256.key", contents=JWT_KEY
self.fs.create_file("/var/snap/slurm/common/var/lib/slurm/slurm.state/jwt_hs256.key")
self.manager.jwt._keyfile_path = Path(
"/var/snap/slurm/common/var/lib/slurm/slurm.state/jwt_hs256.key"
)
self.manager.jwt._keyfile_path.write_text(JWT_KEY)

def test_config_name(self, *_) -> None:
"""Test that the config name is correctly set."""
Expand Down

0 comments on commit 704777d

Please sign in to comment.