11import json
2- import os
32from pathlib import Path
43
54import pytest
4140}
4241
4342
44- _settings = {
43+ _read_settings = {
4544 "name" : "cz_jira" ,
4645 "version" : "1.0.0" ,
4746 "version_provider" : "commitizen" ,
8584 "version_type" : None ,
8685}
8786
88- _read_settings = {
89- "name" : "cz_jira" ,
90- "version" : "1.0.0" ,
91- "version_files" : ["commitizen/__version__.py" , "pyproject.toml" ],
92- "style" : [["pointer" , "reverse" ], ["question" , "underline" ]],
93- "changelog_file" : "CHANGELOG.md" ,
94- "pre_bump_hooks" : ["scripts/generate_documentation.sh" ],
95- "post_bump_hooks" : ["scripts/slack_notification.sh" ],
96- }
97-
9887
9988@pytest .fixture
10089def config_files_manager (request , tmpdir ):
@@ -111,7 +100,7 @@ def config_files_manager(request, tmpdir):
111100
112101
113102def test_find_git_project_root (tmpdir ):
114- assert git .find_git_project_root () == Path (os . getcwd ())
103+ assert git .find_git_project_root () == Path (__file__ ). parent . parent
115104
116105 with tmpdir .as_cwd () as _ :
117106 assert git .find_git_project_root () is None
@@ -133,7 +122,7 @@ class TestReadCfg:
133122 )
134123 def test_load_conf (_ , config_files_manager ):
135124 cfg = config .read_cfg ()
136- assert cfg .settings == _settings
125+ assert cfg .settings == _read_settings
137126
138127 def test_conf_returns_default_when_no_files (_ , tmpdir ):
139128 with tmpdir .as_cwd ():
@@ -148,7 +137,7 @@ def test_load_empty_pyproject_toml_and_cz_toml_with_config(_, tmpdir):
148137 p .write (PYPROJECT )
149138
150139 cfg = config .read_cfg ()
151- assert cfg .settings == _settings
140+ assert cfg .settings == _read_settings
152141
153142
154143class TestTomlConfig :
0 commit comments