Skip to content

Commit 032b129

Browse files
authored
merge(#39): test conventions generation
Test conventions generation
2 parents 3f8ece5 + a0eb21c commit 032b129

File tree

2 files changed

+37
-11
lines changed

2 files changed

+37
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,5 @@ Supported conventions available:
120120
## Our collaborators
121121
| **Name** | **Username** |
122122
| :------: | :----------: |
123-
| Arthur José Benedito de Oliveira Assis | @arthur120496 |
123+
| Arthur José Benedito de Oliveira Assis | @arthur0496 |
124124
| Matheus Richard T. Gomes | @MatheusRich |

test/test_conventions.py

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
1-
# import pytest
2-
# import conventions.karma_angular as angular
3-
# import conventions.changelog as changelog
4-
# import convention.symphony_cmf as symphony
5-
# import conventions.no_convention as no_convention
1+
import pytest
2+
import conventions.karma_angular as angular
3+
import conventions.changelog as changelog
4+
import conventions.symphony_cmf as symphony
5+
import conventions.no_convention as no_convention
66

77

8-
def test_angular_convention():
9-
pass
8+
def test_angular_convention_with_context():
9+
message = angular.angular_convention('TAG', 'message', 'context')
10+
11+
if not ('tag(context): message\n'):
12+
raise AssertionError()
13+
14+
15+
def test_angular_convention_without_context():
16+
message = angular.angular_convention('tag', 'message', '')
17+
18+
if not ('tag: message\n'):
19+
raise AssertionError()
1020

1121

1222
def test_changelog_convention():
13-
pass
23+
message = changelog.changelog_convention('tag', 'message')
24+
25+
if not ('TAG: message\n'):
26+
raise AssertionError()
1427

1528

1629
def test_symphony_convention():
17-
pass
30+
message = symphony.symphony_convention('tag', 'message')
31+
32+
if not ('[Tag] message\n'):
33+
raise AssertionError()
1834

1935

2036
def test_no_convention():
21-
pass
37+
inputs = [
38+
"message",
39+
]
40+
41+
def mock_input(s):
42+
return inputs.pop(0)
43+
no_convention.input = mock_input
44+
45+
message = no_convention.just_message()
46+
if not message == 'Message\n':
47+
raise AssertionError()

0 commit comments

Comments
 (0)