{"action":"created","comment":{"url":"https://api.github.com/repos/SatelliteQE/testimony/pulls/comments/45398437","id":45398437,"diff_hunk":"@@ -450,6 +462,43 @@ def bugs_report(testcases):\n     )\n \n \n+def tags_report(testcases):\n+    \"\"\"Lists the test cases matching the input tag.\"\"\"\n+    result = {}\n+    result['tagged_testcases'] = []\n+    if not SETTINGS['input_tags']:\n+        print 'Input tags required for this report.  See testimony --help'\n+        sys.exit()\n+    # Change the input tags to lower case\n+    input_tags_list = [tag.lower() for tag in SETTINGS['input_tags']]\n+    for _, tests in testcases.items():\n+        for testcase in tests:\n+            if testcase.tags:\n+                # Split the test case tags with ',' and change to lowercase\n+                # and trim empty spaces\n+                testcase_tags_list = [\n+                    tag.lower().strip()\n+                    for tag in testcase.tags.split(',')\n+                ]\n+                # Check if any items in either list match. If so, derive the\n+                # full path of the test case. Expected sample output:\n+                # `tests.test_sample.Testsample1.test_positive_login_1`\n+                if (len(set(testcase_tags_list).intersection(\n+                        input_tags_list)) >= 1):\n+                    value = testcase.testmodule\n+                    if testcase.parent_class:\n+                        value = value + '.' + testcase.parent_class\n+                    value = value + '.' + testcase.name\n+                    value = value.replace('/', '.')\n+                    value = value.replace('.py', '', 1)\n+                    result['tagged_testcases'].append(value)\n+    if SETTINGS['json']:\n+        print json.dumps(result)\n+        return\n+    else:","path":"testimony/__init__.py","position":128,"original_position":128,"commit_id":"47dcfa38d06c8cbb403c9ff610f1127304d7babc","original_commit_id":"47dcfa38d06c8cbb403c9ff610f1127304d7babc","user":{"login":"sthirugn","id":3309189,"avatar_url":"https://avatars.githubusercontent.com/u/3309189?v=3","gravatar_id":"","url":"https://api.github.com/users/sthirugn","html_url":"https://github.com/sthirugn","followers_url":"https://api.github.com/users/sthirugn/followers","following_url":"https://api.github.com/users/sthirugn/following{/other_user}","gists_url":"https://api.github.com/users/sthirugn/gists{/gist_id}","starred_url":"https://api.github.com/users/sthirugn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sthirugn/subscriptions","organizations_url":"https://api.github.com/users/sthirugn/orgs","repos_url":"https://api.github.com/users/sthirugn/repos","events_url":"https://api.github.com/users/sthirugn/events{/privacy}","received_events_url":"https://api.github.com/users/sthirugn/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-11-19T20:52:18Z","updated_at":"2015-11-19T20:52:18Z","html_url":"https://github.com/SatelliteQE/testimony/pull/74#discussion_r45398437","pull_request_url":"https://api.github.com/repos/SatelliteQE/testimony/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/testimony/pulls/comments/45398437"},"html":{"href":"https://github.com/SatelliteQE/testimony/pull/74#discussion_r45398437"},"pull_request":{"href":"https://api.github.com/repos/SatelliteQE/testimony/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/testimony/pulls/74","id":51126303,"html_url":"https://github.com/SatelliteQE/testimony/pull/74","diff_url":"https://github.com/SatelliteQE/testimony/pull/74.diff","patch_url":"https://github.com/SatelliteQE/testimony/pull/74.patch","issue_url":"https://api.github.com/repos/SatelliteQE/testimony/issues/74","number":74,"state":"open","locked":false,"title":"Added support for adding test case tags","user":{"login":"sthirugn","id":3309189,"avatar_url":"https://avatars.githubusercontent.com/u/3309189?v=3","gravatar_id":"","url":"https://api.github.com/users/sthirugn","html_url":"https://github.com/sthirugn","followers_url":"https://api.github.com/users/sthirugn/followers","following_url":"https://api.github.com/users/sthirugn/following{/other_user}","gists_url":"https://api.github.com/users/sthirugn/gists{/gist_id}","starred_url":"https://api.github.com/users/sthirugn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sthirugn/subscriptions","organizations_url":"https://api.github.com/users/sthirugn/orgs","repos_url":"https://api.github.com/users/sthirugn/repos","events_url":"https://api.github.com/users/sthirugn/events{/privacy}","received_events_url":"https://api.github.com/users/sthirugn/received_events","type":"User","site_admin":false},"body":"Test results:\r\nPositive:\r\n```sh\r\n# testimony tags tests/ --tag='t1'\r\n['tests.test_sample.Testsample1.test_positive_login_1', 'tests.test_sample.Testsample1.test_positive_login_3']\r\n\r\n# testimony tags tests/ --tag='t2'\r\n['tests.test_sample.Testsample1.test_positive_login_1', 'tests.test_sample.Testsample1.test_negative_login_5']\r\n\r\n# testimony tags tests/ --tag='t3'\r\n['tests.test_sample.Testsample1.test_positive_login_1']\r\n\r\n# testimony tags tests/ --tag='t1,t2,t3'\r\n['tests.test_sample.Testsample1.test_positive_login_1', 'tests.test_sample.Testsample1.test_positive_login_3', 'tests.test_sample.Testsample1.test_negative_login_5']\r\n```\r\nNegative:\r\n```sh\r\n# testimony tags tests/\r\nInput tags required for this report.  See testimony --help\r\n\r\n# testimony tags tests/ --tag='t1,  t2,    t3'\r\nInput tags should be separated by commas only - Spaces or other special characters may create incorrect reports\r\n```\r\n\r\nCloses https://github.com/SatelliteQE/testimony/issues/73","created_at":"2015-11-18T19:00:09Z","updated_at":"2015-11-19T20:52:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8725a6bde35f6e420e69c8e5b61bf10eadabcb7b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SatelliteQE/testimony/pulls/74/commits","review_comments_url":"https://api.github.com/repos/SatelliteQE/testimony/pulls/74/comments","review_comment_url":"https://api.github.com/repos/SatelliteQE/testimony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SatelliteQE/testimony/issues/74/comments","statuses_url":"https://api.github.com/repos/SatelliteQE/testimony/statuses/47dcfa38d06c8cbb403c9ff610f1127304d7babc","head":{"label":"sthirugn:tags","ref":"tags","sha":"47dcfa38d06c8cbb403c9ff610f1127304d7babc","user":{"login":"sthirugn","id":3309189,"avatar_url":"https://avatars.githubusercontent.com/u/3309189?v=3","gravatar_id":"","url":"https://api.github.com/users/sthirugn","html_url":"https://github.com/sthirugn","followers_url":"https://api.github.com/users/sthirugn/followers","following_url":"https://api.github.com/users/sthirugn/following{/other_user}","gists_url":"https://api.github.com/users/sthirugn/gists{/gist_id}","starred_url":"https://api.github.com/users/sthirugn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sthirugn/subscriptions","organizations_url":"https://api.github.com/users/sthirugn/orgs","repos_url":"https://api.github.com/users/sthirugn/repos","events_url":"https://api.github.com/users/sthirugn/events{/privacy}","received_events_url":"https://api.github.com/users/sthirugn/received_events","type":"User","site_admin":false},"repo":{"id":29918530,"name":"testimony","full_name":"sthirugn/testimony","owner":{"login":"sthirugn","id":3309189,"avatar_url":"https://avatars.githubusercontent.com/u/3309189?v=3","gravatar_id":"","url":"https://api.github.com/users/sthirugn","html_url":"https://github.com/sthirugn","followers_url":"https://api.github.com/users/sthirugn/followers","following_url":"https://api.github.com/users/sthirugn/following{/other_user}","gists_url":"https://api.github.com/users/sthirugn/gists{/gist_id}","starred_url":"https://api.github.com/users/sthirugn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sthirugn/subscriptions","organizations_url":"https://api.github.com/users/sthirugn/orgs","repos_url":"https://api.github.com/users/sthirugn/repos","events_url":"https://api.github.com/users/sthirugn/events{/privacy}","received_events_url":"https://api.github.com/users/sthirugn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sthirugn/testimony","description":"Inspect and Report python test cases using test case docstrings","fork":true,"url":"https://api.github.com/repos/sthirugn/testimony","forks_url":"https://api.github.com/repos/sthirugn/testimony/forks","keys_url":"https://api.github.com/repos/sthirugn/testimony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sthirugn/testimony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sthirugn/testimony/teams","hooks_url":"https://api.github.com/repos/sthirugn/testimony/hooks","issue_events_url":"https://api.github.com/repos/sthirugn/testimony/issues/events{/number}","events_url":"https://api.github.com/repos/sthirugn/testimony/events","assignees_url":"https://api.github.com/repos/sthirugn/testimony/assignees{/user}","branches_url":"https://api.github.com/repos/sthirugn/testimony/branches{/branch}","tags_url":"https://api.github.com/repos/sthirugn/testimony/tags","blobs_url":"https://api.github.com/repos/sthirugn/testimony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sthirugn/testimony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sthirugn/testimony/git/refs{/sha}","trees_url":"https://api.github.com/repos/sthirugn/testimony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sthirugn/testimony/statuses/{sha}","languages_url":"https://api.github.com/repos/sthirugn/testimony/languages","stargazers_url":"https://api.github.com/repos/sthirugn/testimony/stargazers","contributors_url":"https://api.github.com/repos/sthirugn/testimony/contributors","subscribers_url":"https://api.github.com/repos/sthirugn/testimony/subscribers","subscription_url":"https://api.github.com/repos/sthirugn/testimony/subscription","commits_url":"https://api.github.com/repos/sthirugn/testimony/commits{/sha}","git_commits_url":"https://api.github.com/repos/sthirugn/testimony/git/commits{/sha}","comments_url":"https://api.github.com/repos/sthirugn/testimony/comments{/number}","issue_comment_url":"https://api.github.com/repos/sthirugn/testimony/issues/comments{/number}","contents_url":"https://api.github.com/repos/sthirugn/testimony/contents/{+path}","compare_url":"https://api.github.com/repos/sthirugn/testimony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sthirugn/testimony/merges","archive_url":"https://api.github.com/repos/sthirugn/testimony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sthirugn/testimony/downloads","issues_url":"https://api.github.com/repos/sthirugn/testimony/issues{/number}","pulls_url":"https://api.github.com/repos/sthirugn/testimony/pulls{/number}","milestones_url":"https://api.github.com/repos/sthirugn/testimony/milestones{/number}","notifications_url":"https://api.github.com/repos/sthirugn/testimony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sthirugn/testimony/labels{/name}","releases_url":"https://api.github.com/repos/sthirugn/testimony/releases{/id}","created_at":"2015-01-27T14:50:38Z","updated_at":"2015-01-27T14:50:38Z","pushed_at":"2015-11-18T20:32:06Z","git_url":"git://github.com/sthirugn/testimony.git","ssh_url":"git@github.com:sthirugn/testimony.git","clone_url":"https://github.com/sthirugn/testimony.git","svn_url":"https://github.com/sthirugn/testimony","homepage":"","size":92,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SatelliteQE:master","ref":"master","sha":"39b5cc59866e1e7d4aaa3fc6d723ddc28bde7711","user":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"repo":{"id":16013320,"name":"testimony","full_name":"SatelliteQE/testimony","owner":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SatelliteQE/testimony","description":"Inspect and Report python test cases using test case docstrings","fork":false,"url":"https://api.github.com/repos/SatelliteQE/testimony","forks_url":"https://api.github.com/repos/SatelliteQE/testimony/forks","keys_url":"https://api.github.com/repos/SatelliteQE/testimony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SatelliteQE/testimony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SatelliteQE/testimony/teams","hooks_url":"https://api.github.com/repos/SatelliteQE/testimony/hooks","issue_events_url":"https://api.github.com/repos/SatelliteQE/testimony/issues/events{/number}","events_url":"https://api.github.com/repos/SatelliteQE/testimony/events","assignees_url":"https://api.github.com/repos/SatelliteQE/testimony/assignees{/user}","branches_url":"https://api.github.com/repos/SatelliteQE/testimony/branches{/branch}","tags_url":"https://api.github.com/repos/SatelliteQE/testimony/tags","blobs_url":"https://api.github.com/repos/SatelliteQE/testimony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SatelliteQE/testimony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SatelliteQE/testimony/git/refs{/sha}","trees_url":"https://api.github.com/repos/SatelliteQE/testimony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SatelliteQE/testimony/statuses/{sha}","languages_url":"https://api.github.com/repos/SatelliteQE/testimony/languages","stargazers_url":"https://api.github.com/repos/SatelliteQE/testimony/stargazers","contributors_url":"https://api.github.com/repos/SatelliteQE/testimony/contributors","subscribers_url":"https://api.github.com/repos/SatelliteQE/testimony/subscribers","subscription_url":"https://api.github.com/repos/SatelliteQE/testimony/subscription","commits_url":"https://api.github.com/repos/SatelliteQE/testimony/commits{/sha}","git_commits_url":"https://api.github.com/repos/SatelliteQE/testimony/git/commits{/sha}","comments_url":"https://api.github.com/repos/SatelliteQE/testimony/comments{/number}","issue_comment_url":"https://api.github.com/repos/SatelliteQE/testimony/issues/comments{/number}","contents_url":"https://api.github.com/repos/SatelliteQE/testimony/contents/{+path}","compare_url":"https://api.github.com/repos/SatelliteQE/testimony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SatelliteQE/testimony/merges","archive_url":"https://api.github.com/repos/SatelliteQE/testimony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SatelliteQE/testimony/downloads","issues_url":"https://api.github.com/repos/SatelliteQE/testimony/issues{/number}","pulls_url":"https://api.github.com/repos/SatelliteQE/testimony/pulls{/number}","milestones_url":"https://api.github.com/repos/SatelliteQE/testimony/milestones{/number}","notifications_url":"https://api.github.com/repos/SatelliteQE/testimony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SatelliteQE/testimony/labels{/name}","releases_url":"https://api.github.com/repos/SatelliteQE/testimony/releases{/id}","created_at":"2014-01-17T22:16:41Z","updated_at":"2015-04-16T19:32:36Z","pushed_at":"2015-11-19T20:51:10Z","git_url":"git://github.com/SatelliteQE/testimony.git","ssh_url":"git@github.com:SatelliteQE/testimony.git","clone_url":"https://github.com/SatelliteQE/testimony.git","svn_url":"https://github.com/SatelliteQE/testimony","homepage":"","size":544,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":10,"forks":6,"open_issues":10,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/testimony/pulls/74"},"html":{"href":"https://github.com/SatelliteQE/testimony/pull/74"},"issue":{"href":"https://api.github.com/repos/SatelliteQE/testimony/issues/74"},"comments":{"href":"https://api.github.com/repos/SatelliteQE/testimony/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/SatelliteQE/testimony/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/SatelliteQE/testimony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SatelliteQE/testimony/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/SatelliteQE/testimony/statuses/47dcfa38d06c8cbb403c9ff610f1127304d7babc"}}}}