1
1
import json
2
- import os
3
2
from pathlib import Path
4
3
5
4
import pytest
41
40
}
42
41
43
42
44
- _settings = {
43
+ _read_settings = {
45
44
"name" : "cz_jira" ,
46
45
"version" : "1.0.0" ,
47
46
"tag_format" : "$version" ,
79
78
"prerelease_offset" : 0 ,
80
79
}
81
80
82
- _read_settings = {
83
- "name" : "cz_jira" ,
84
- "version" : "1.0.0" ,
85
- "version_files" : ["commitizen/__version__.py" , "pyproject.toml" ],
86
- "style" : [["pointer" , "reverse" ], ["question" , "underline" ]],
87
- "changelog_file" : "CHANGELOG.md" ,
88
- "pre_bump_hooks" : ["scripts/generate_documentation.sh" ],
89
- "post_bump_hooks" : ["scripts/slack_notification.sh" ],
90
- }
91
-
92
81
93
82
@pytest .fixture
94
83
def config_files_manager (request , tmpdir ):
@@ -105,7 +94,7 @@ def config_files_manager(request, tmpdir):
105
94
106
95
107
96
def test_find_git_project_root (tmpdir ):
108
- assert git .find_git_project_root () == Path (os . getcwd ())
97
+ assert git .find_git_project_root () == Path (__file__ ). parent . parent
109
98
110
99
with tmpdir .as_cwd () as _ :
111
100
assert git .find_git_project_root () is None
@@ -127,7 +116,7 @@ class TestReadCfg:
127
116
)
128
117
def test_load_conf (_ , config_files_manager ):
129
118
cfg = config .read_cfg ()
130
- assert cfg .settings == _settings
119
+ assert cfg .settings == _read_settings
131
120
132
121
def test_conf_returns_default_when_no_files (_ , tmpdir ):
133
122
with tmpdir .as_cwd ():
@@ -142,7 +131,7 @@ def test_load_empty_pyproject_toml_and_cz_toml_with_config(_, tmpdir):
142
131
p .write (PYPROJECT )
143
132
144
133
cfg = config .read_cfg ()
145
- assert cfg .settings == _settings
134
+ assert cfg .settings == _read_settings
146
135
147
136
148
137
class TestTomlConfig :
0 commit comments