|
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 |
6 | 6 |
|
7 | 7 |
|
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() |
10 | 20 |
|
11 | 21 |
|
12 | 22 | def test_changelog_convention(): |
13 | | - pass |
| 23 | + message = changelog.changelog_convention('tag', 'message') |
| 24 | + |
| 25 | + if not ('TAG: message\n'): |
| 26 | + raise AssertionError() |
14 | 27 |
|
15 | 28 |
|
16 | 29 | def test_symphony_convention(): |
17 | | - pass |
| 30 | + message = symphony.symphony_convention('tag', 'message') |
| 31 | + |
| 32 | + if not ('[Tag] message\n'): |
| 33 | + raise AssertionError() |
18 | 34 |
|
19 | 35 |
|
20 | 36 | 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