|
3 | 3 | from semantic_release.errors import UnknownCommitMessageStyleError
|
4 | 4 | from semantic_release.history import angular_parser
|
5 | 5 |
|
6 |
| -from .. import mock,wrapped_config_get |
| 6 | +from .. import mock, wrapped_config_get |
7 | 7 |
|
8 | 8 | text = (
|
9 | 9 | "This is an long explanatory part of a commit message. It should give "
|
@@ -100,32 +100,41 @@ def test_parser_should_accept_message_without_scope():
|
100 | 100 | assert angular_parser("fix: superfix")[0] == 1
|
101 | 101 | assert angular_parser("fix: superfix")[3][0] == "superfix"
|
102 | 102 |
|
| 103 | + |
103 | 104 | ##############################
|
104 | 105 | # test custom parser options #
|
105 | 106 | ##############################
|
106 |
| -@mock.patch("semantic_release.history.parser_angular.config.get", |
107 |
| - wrapped_config_get(parser_angular_default_level_bump='minor')) |
| 107 | +@mock.patch( |
| 108 | + "semantic_release.history.parser_angular.config.get", |
| 109 | + wrapped_config_get(parser_angular_default_level_bump="minor"), |
| 110 | +) |
108 | 111 | def test_parser_custom_default_level():
|
109 | 112 | assert angular_parser("test(parser): Add a test for angular parser")[0] == 2
|
110 | 113 |
|
111 | 114 |
|
112 |
| -@mock.patch("semantic_release.history.parser_angular.config.get", |
113 |
| - wrapped_config_get( |
114 |
| - parser_angular_allowed_types= |
115 |
| - 'custom,build,chore,ci,docs,fix,perf,style,refactor,test')) |
| 115 | +@mock.patch( |
| 116 | + "semantic_release.history.parser_angular.config.get", |
| 117 | + wrapped_config_get( |
| 118 | + parser_angular_allowed_types="custom,build,chore,ci,docs,fix,perf,style,refactor,test" |
| 119 | + ), |
| 120 | +) |
116 | 121 | def test_parser_custom_allowed_types():
|
117 | 122 | assert angular_parser("custom: ...")[0] == 0
|
118 | 123 | assert angular_parser("custom(parser): ...")[1] == "custom"
|
119 | 124 | pytest.raises(UnknownCommitMessageStyleError, angular_parser, "feat(parser): ...")
|
120 | 125 |
|
121 | 126 |
|
122 |
| -@mock.patch("semantic_release.history.parser_angular.config.get", |
123 |
| - wrapped_config_get(parser_angular_minor_types='docs')) |
| 127 | +@mock.patch( |
| 128 | + "semantic_release.history.parser_angular.config.get", |
| 129 | + wrapped_config_get(parser_angular_minor_types="docs"), |
| 130 | +) |
124 | 131 | def test_parser_custom_minor_types():
|
125 | 132 | assert angular_parser("docs: write some docs")[0] == 2
|
126 | 133 |
|
127 | 134 |
|
128 |
| -@mock.patch("semantic_release.history.parser_angular.config.get", |
129 |
| - wrapped_config_get(parser_angular_patch_types='test')) |
| 135 | +@mock.patch( |
| 136 | + "semantic_release.history.parser_angular.config.get", |
| 137 | + wrapped_config_get(parser_angular_patch_types="test"), |
| 138 | +) |
130 | 139 | def test_parser_custom_patch_types():
|
131 | 140 | assert angular_parser("test(this): added a test")[0] == 1
|
0 commit comments