Skip to content

Commit

Permalink
Some fixes to the git_helpers test
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Jul 10, 2023
1 parent 7a9c572 commit 35991b8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ska_helpers/tests/test_git_helpers.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
import pytest
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import getpass
import tempfile
from ska_helpers import git_helpers

import git
import os
from pathlib import Path
import pytest

from ska_helpers import git_helpers, paths

CHANDRA_MODELS = Path(os.environ["SKA"]) / "data" / "chandra_models"
CHANDRA_MODELS = paths.chandra_models_repo_path()


def ska_ownership_ok():
# Check that the OS and volume support file ownership
# (not the case with shared directories on a Windows VM on parallels)
# and that the chandra_models dir is owned by the current user
try:
return CHANDRA_MODELS.owner() == os.getlogin()
return CHANDRA_MODELS.owner() == getpass.getuser()
except Exception:
return False


@pytest.mark.skipif(
not CHANDRA_MODELS.exists(), reason="Chandra models dir is not there"
not CHANDRA_MODELS.exists(),
reason="Chandra models dir is not there",
)
@pytest.mark.skipif(ska_ownership_ok(), reason="Chandra models dir ownership is OK")
def test_make_git_repo_safe(monkeypatch):
Expand Down

0 comments on commit 35991b8

Please sign in to comment.