Mercurial > kallithea
changeset 7442:1c68258b14bc
tests: notifications: increase indentation of multi-line for loop condition
Code in question is:
for foo in [
item1,
item2,
item3]:
action1
action2
With the above indentation, a quick glance at the code does not show where
the actions start.
Using a double indentation for line continuation avoids this problem:
for foo in [
item1,
item2,
item3]:
action1
action2
There are no actual code changes in this commit.
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> |
---|---|
date | Sat, 01 Dec 2018 22:04:58 +0100 |
parents | cf1d1239cd55 |
children | 5d7c1f73a5b8 |
files | kallithea/tests/models/test_notifications.py |
diffstat | 1 files changed, 44 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/tests/models/test_notifications.py Wed Nov 28 21:22:28 2018 +0100 +++ b/kallithea/tests/models/test_notifications.py Sat Dec 01 22:04:58 2018 +0100 @@ -208,50 +208,50 @@ ) for type_, body, kwargs in [ - (Notification.TYPE_CHANGESET_COMMENT, - u'This is the new \'comment\'.\n\n - and here it ends indented.', - dict( - short_id='cafe1234', - raw_id='cafe1234c0ffeecafe', - branch='brunch', - cs_comment_user='Opinionated User (jsmith)', - cs_comment_url='http://comment.org', - is_mention=[False, True], - message='This changeset did something clever which is hard to explain', - message_short='This changeset did something cl...', - status_change=[None, 'Approved'], - cs_target_repo='http://example.com/repo_target', - cs_url='http://changeset.com', - cs_author=User.get(self.u2))), - (Notification.TYPE_MESSAGE, - u'This is the \'body\' of the "test" message\n - nothing interesting here except indentation.', - dict()), - #(Notification.TYPE_MENTION, '$body', None), # not used - (Notification.TYPE_REGISTRATION, - u'Registration body', - dict( - new_username='newbie', - registered_user_url='http://newbie.org', - new_email='new@email.com', - new_full_name='New Full Name')), - (Notification.TYPE_PULL_REQUEST, - u'This PR is \'awesome\' because it does <stuff>\n - please approve indented!', - dict( - pr_user_created='Requesting User (root)', # pr_owner should perhaps be used for @mention in description ... - is_mention=[False, True], - pr_revisions=[('123abc'*7, "Introduce one and two\n\nand that's it"), ('567fed'*7, 'Make one plus two equal tree')], - org_repo_name='repo_org', - **pr_kwargs)), - (Notification.TYPE_PULL_REQUEST_COMMENT, - u'Me too!\n\n - and indented on second line', - dict( - closing_pr=[False, True], - is_mention=[False, True], - pr_comment_user='Opinionated User (jsmith)', - pr_comment_url='http://pr.org/comment', - status_change=[None, 'Under Review'], - **pr_kwargs)), - ]: + (Notification.TYPE_CHANGESET_COMMENT, + u'This is the new \'comment\'.\n\n - and here it ends indented.', + dict( + short_id='cafe1234', + raw_id='cafe1234c0ffeecafe', + branch='brunch', + cs_comment_user='Opinionated User (jsmith)', + cs_comment_url='http://comment.org', + is_mention=[False, True], + message='This changeset did something clever which is hard to explain', + message_short='This changeset did something cl...', + status_change=[None, 'Approved'], + cs_target_repo='http://example.com/repo_target', + cs_url='http://changeset.com', + cs_author=User.get(self.u2))), + (Notification.TYPE_MESSAGE, + u'This is the \'body\' of the "test" message\n - nothing interesting here except indentation.', + dict()), + #(Notification.TYPE_MENTION, '$body', None), # not used + (Notification.TYPE_REGISTRATION, + u'Registration body', + dict( + new_username='newbie', + registered_user_url='http://newbie.org', + new_email='new@email.com', + new_full_name='New Full Name')), + (Notification.TYPE_PULL_REQUEST, + u'This PR is \'awesome\' because it does <stuff>\n - please approve indented!', + dict( + pr_user_created='Requesting User (root)', # pr_owner should perhaps be used for @mention in description ... + is_mention=[False, True], + pr_revisions=[('123abc'*7, "Introduce one and two\n\nand that's it"), ('567fed'*7, 'Make one plus two equal tree')], + org_repo_name='repo_org', + **pr_kwargs)), + (Notification.TYPE_PULL_REQUEST_COMMENT, + u'Me too!\n\n - and indented on second line', + dict( + closing_pr=[False, True], + is_mention=[False, True], + pr_comment_user='Opinionated User (jsmith)', + pr_comment_url='http://pr.org/comment', + status_change=[None, 'Under Review'], + **pr_kwargs)), + ]: kwargs['repo_name'] = u'repo/name' params = [(type_, type_, body, kwargs)] for param_name in ['is_mention', 'status_change', 'closing_pr']: # TODO: inline/general