Skip to content

Commit 1a7af8d

Browse files
committed
test(initialize): rename 'test_resources_path' to just 'resources_path' to avoid the function being interpreted as a test
1 parent 5ceb8ec commit 1a7af8d

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

test/initialize/delivery/test_init_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from instant_python.shared.supported_managers import SupportedManagers
1313
from instant_python.shared.supported_python_versions import SupportedPythonVersions
1414
from instant_python.shared.supported_templates import SupportedTemplates
15-
from test.initialize.utils import test_resources_path
15+
from test.initialize.utils import resources_path
1616

1717

1818
@pytest.mark.acceptance
@@ -173,6 +173,6 @@ def _create_template_config(
173173

174174
@staticmethod
175175
def _read_base_config() -> dict:
176-
resources_path = test_resources_path() / "base_ipy_config.yml"
177-
with resources_path.open("r") as file:
176+
base_config_path = resources_path() / "base_ipy_config.yml"
177+
with base_config_path.open("r") as file:
178178
return yaml.safe_load(file)

test/initialize/infra/persistence/test_configuration_repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
from instant_python.configuration.parser.configuration_file_not_found import ConfigurationFileNotFound
77
from instant_python.initialize.infra.persistence.config_repository import YamlConfigRepository
8-
from test.initialize.utils import test_resources_path
8+
from test.initialize.utils import resources_path
99

1010

1111
class TestConfigurationRepository:
1212
def test_should_read_existing_config_file(self) -> None:
1313
repository = YamlConfigRepository()
14-
config_path = str(test_resources_path() / "base_ipy_config.yml")
14+
config_path = str(resources_path() / "base_ipy_config.yml")
1515

1616
raw_config = repository.read(config_path)
1717

test/initialize/infra/renderer/test_jinja_environment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
from jinja2 import TemplateNotFound
33

44
from instant_python.initialize.infra.renderer.jinja_environment import JinjaEnvironment
5-
from test.initialize.utils import test_resources_path
5+
from test.initialize.utils import resources_path
66

77

88
class TestJinjaEnvironment:
99
def setup_method(self) -> None:
10-
self._jinja_environment = JinjaEnvironment(user_template_path=str(test_resources_path()))
10+
self._jinja_environment = JinjaEnvironment(user_template_path=str(resources_path()))
1111

1212
def test_should_initialize_environment(self) -> None:
1313
expect(self._jinja_environment._env).not_to(be_none)

test/initialize/infra/renderer/test_jinja_project_renderer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
from instant_python.project_creator.node import NodeType
66
from instant_python.shared.supported_templates import SupportedTemplates
77
from test.config.domain.mothers.config_schema_mother import ConfigSchemaMother
8-
from test.initialize.utils import test_resources_path
8+
from test.initialize.utils import resources_path
99

1010

1111
class TestJinjaProjectRenderer:
1212
def test_should_render_standard_project_structure(self) -> None:
1313
config = ConfigSchemaMother.with_template(
1414
template=SupportedTemplates.STANDARD.value
1515
)
16-
renderer = JinjaProjectRenderer(env=JinjaEnvironment(str(test_resources_path())))
16+
renderer = JinjaProjectRenderer(env=JinjaEnvironment(str(resources_path())))
1717

1818
project_structure = renderer.render(context_config=config)
1919

@@ -24,7 +24,7 @@ def test_should_include_file_template_content_in_project_structure(self) -> None
2424
config = ConfigSchemaMother.with_template(
2525
template=SupportedTemplates.STANDARD.value
2626
)
27-
renderer = JinjaProjectRenderer(env=JinjaEnvironment(str(test_resources_path())))
27+
renderer = JinjaProjectRenderer(env=JinjaEnvironment(str(resources_path())))
2828

2929
project_structure = renderer.render(context_config=config)
3030

test/initialize/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pathlib import Path
22

33

4-
def test_resources_path() -> Path:
4+
def resources_path() -> Path:
55
return Path("test").resolve() / "resources"

0 commit comments

Comments
 (0)