Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanBryan51 committed Apr 4, 2024
1 parent d064512 commit cdd5e5b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 2 additions & 3 deletions tests/test_fluxsite.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import f90nml
import netCDF4
import pytest

from benchcab import __version__, internal
from benchcab.fluxsite import (
CableError,
Expand Down Expand Up @@ -107,7 +106,7 @@ def _setup(self, task):
(internal.FLUXSITE_DIRS["OUTPUT"]).mkdir(parents=True)
(internal.FLUXSITE_DIRS["LOG"]).mkdir(parents=True)

exe_build_dir = internal.SRC_DIR / "test-branch" / "offline"
exe_build_dir = internal.SRC_DIR / "test-branch" / "bin"
exe_build_dir.mkdir(parents=True)
(exe_build_dir / internal.CABLE_EXE).touch()

Expand Down Expand Up @@ -170,7 +169,7 @@ def _setup(self, task):
(internal.FLUXSITE_DIRS["OUTPUT"]).mkdir(parents=True)
(internal.FLUXSITE_DIRS["LOG"]).mkdir(parents=True)

exe_build_dir = internal.SRC_DIR / "test-branch" / "offline"
exe_build_dir = internal.SRC_DIR / "test-branch" / "bin"
exe_build_dir.mkdir(parents=True)
(exe_build_dir / internal.CABLE_EXE).touch()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_get_exe_path(self, model, mpi, expected_exe):
"""Success case: get path to executable."""
assert (
model.get_exe_path(mpi=mpi)
== internal.SRC_DIR / model.name / "offline" / expected_exe
== internal.SRC_DIR / model.name / "bin" / expected_exe
)


Expand Down
7 changes: 1 addition & 6 deletions tests/test_spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@
pytest autouse fixture.
"""

import contextlib
import io
import logging
from pathlib import Path

import f90nml
import pytest
import yaml

from benchcab import internal
from benchcab.model import Model
from benchcab.spatial import SpatialTask, get_spatial_tasks
from benchcab.utils import get_logger
from benchcab.utils.repo import Repo


Expand Down Expand Up @@ -92,7 +87,7 @@ def test_payu_config_parameters(self, task):
config = yaml.safe_load(file)
assert config["exe"] == str(
(
internal.SRC_DIR / "test-branch" / "offline" / internal.CABLE_MPI_EXE
internal.SRC_DIR / "test-branch" / "bin" / internal.CABLE_MPI_EXE
).absolute()
)
assert config["laboratory"] == str(internal.PAYU_LABORATORY_DIR.absolute())
Expand Down

0 comments on commit cdd5e5b

Please sign in to comment.