Merge pull request #167 from ancorgs/nicer_select_comments

Nicer comments (using the improved OBS markup) for (un)select
This commit is contained in:
Alberto Planas 2014-06-17 11:51:39 +02:00
commit f3364136a7
2 changed files with 4 additions and 4 deletions

View File

@ -1103,6 +1103,6 @@ class StagingAPI(object):
if not author:
# Old style metadata
author = get_request(self.apiurl, str(req['id'])).get_creator()
lines.append(' * Request req#%s for package %s submitted by [AT]%s' % (req['id'], req['package'], author))
lines.append(' * Request#%s for package %s submitted by [AT]%s' % (req['id'], req['package'], author))
msg = '\n'.join(lines)
comment_api.add_comment(project_name=project, comment=msg)

View File

@ -43,7 +43,7 @@ class TestSelect(unittest.TestCase):
# Only one comment is added
self.assertEqual(len(first_select_comments), len(comments) + 1)
# With the right content
self.assertTrue('Request req#123 for package gcc submitted by [AT]Admin' in first_select_comment['comment'])
self.assertTrue('Request#123 for package gcc submitted by [AT]Admin' in first_select_comment['comment'])
# Second select
self.assertEqual(True, SelectCommand(self.api).perform(staging_a, ['puppet']))
@ -54,8 +54,8 @@ class TestSelect(unittest.TestCase):
self.assertEqual(len(second_select_comments), len(first_select_comments))
self.assertNotEqual(second_select_comment['comment'], first_select_comment['comment'])
# The new comments contents both old and new information
self.assertTrue('Request req#123 for package gcc submitted by [AT]Admin' in second_select_comment['comment'])
self.assertTrue('Request req#321 for package puppet submitted by [AT]Admin' in second_select_comment['comment'])
self.assertTrue('Request#123 for package gcc submitted by [AT]Admin' in second_select_comment['comment'])
self.assertTrue('Request#321 for package puppet submitted by [AT]Admin' in second_select_comment['comment'])
def test_no_matches(self):
# search for requests