Skip to content

Commit c224ec3

Browse files
committed
Move test
1 parent 413994d commit c224ec3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed
File renamed without changes.

tests/integration/test_infrahubctl.py renamed to tests/unit/ctl/test_transform_app.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
import pytest
1010
from git import Repo
1111
from pytest_httpx._httpx_mock import HTTPXMock
12-
from typer.testing import Any, CliRunner
12+
from typer.testing import CliRunner
1313

1414
from infrahub_sdk.ctl.cli_commands import app
15-
16-
from .utils import change_directory, strip_color
15+
from tests.helpers.utils import change_directory, strip_color
1716

1817
runner = CliRunner()
1918

2019

21-
FIXTURE_BASE_DIR = Path(Path(os.path.abspath(__file__)).parent / ".." / "fixtures" / "integration" / "test_infrahubctl")
20+
FIXTURE_BASE_DIR = Path(
21+
Path(os.path.abspath(__file__)).parent / ".." / ".." / "fixtures" / "integration" / "test_infrahubctl"
22+
)
2223

2324

24-
def read_fixture(file_name: str, fixture_subdir: str = ".") -> Any:
25+
def read_fixture(file_name: str, fixture_subdir: str = ".") -> str:
2526
"""Read the contents of a fixture."""
2627
with Path(FIXTURE_BASE_DIR / fixture_subdir / file_name).open("r", encoding="utf-8") as fhd:
2728
fixture_contents = fhd.read()
@@ -38,7 +39,7 @@ def tags_transform_dir():
3839
shutil.copytree(fixture_path, temp_dir, dirs_exist_ok=True)
3940
# Initialize fixture as git repo. This is necessary to run some infrahubctl commands.
4041
with change_directory(temp_dir):
41-
Repo.init(".")
42+
Repo.init(".", initial_branch="main")
4243

4344
yield temp_dir
4445

0 commit comments

Comments
 (0)