{"action":"created","comment":{"url":"https://api.github.com/repos/grimoirelab/perceval/pulls/comments/91995013","pull_request_review_id":12437629,"id":91995013,"diff_hunk":"@@ -0,0 +1,266 @@\n+#!/usr/bin/env python3\n+# -*- coding: utf-8 -*-\n+#\n+# Copyright (C) 2015-2016 Bitergia\n+#\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 3 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, write to the Free Software\n+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n+#\n+# Authors:\n+#     Santiago Dueñas <sduenas@bitergia.com>\n+#     Alvaro del Castillo <acs@bitergia.com>\n+#\n+\n+import argparse\n+import json\n+import shutil\n+import sys\n+import tempfile\n+import unittest\n+\n+import httpretty\n+import pkg_resources\n+\n+# Hack to make sure that tests import the right packages\n+# due to setuptools behaviour\n+sys.path.insert(0, '..')\n+pkg_resources.declare_namespace('perceval.backends')\n+\n+from perceval.cache import Cache\n+from perceval.errors import CacheError\n+from perceval.backends.core.rss import (RSS,\n+                                            RSSCommand,\n+                                            RSSClient)\n+\n+\n+RSS_FEED_URL = 'http://example.com/rss'\n+\n+requests_http = []\n+\n+def read_file(filename, mode='r'):\n+    with open(filename, mode) as f:\n+        content = f.read()\n+    return content\n+\n+class TestRSSBackend(unittest.TestCase):\n+    \"\"\"RSS backend tests\"\"\"\n+\n+    def test_initialization(self):\n+        \"\"\"Test whether attributes are initializated\"\"\"\n+\n+        rss = RSS(RSS_FEED_URL, tag='test')\n+\n+        self.assertEqual(rss.url, RSS_FEED_URL)\n+        self.assertEqual(rss.origin, RSS_FEED_URL)\n+        self.assertEqual(rss.tag, 'test')\n+        self.assertIsInstance(rss.client, RSSClient)\n+\n+        # When tag is empty or None it will be set to\n+        # the value in url\n+        rss = RSS(RSS_FEED_URL)\n+        self.assertEqual(rss.url, RSS_FEED_URL)\n+        self.assertEqual(rss.origin, RSS_FEED_URL)\n+        self.assertEqual(rss.tag, RSS_FEED_URL)\n+\n+        rss = RSS(RSS_FEED_URL, tag='')\n+        self.assertEqual(rss.url, RSS_FEED_URL)\n+        self.assertEqual(rss.origin, RSS_FEED_URL)\n+        self.assertEqual(rss.tag, RSS_FEED_URL)\n+\n+    def test_has_caching(self):\n+        \"\"\"Test if it returns True when has_caching is called\"\"\"\n+\n+        self.assertEqual(RSS.has_caching(), True)\n+\n+    def test_has_resuming(self):\n+        \"\"\"Test if it returns False when has_resuming is called\"\"\"\n+\n+        self.assertEqual(RSS.has_resuming(), False)\n+\n+    def __configure_http_server(self):","path":"tests/test_rss.py","position":91,"original_position":91,"commit_id":"537b1e318222221a9033e48290e266996b4e3a2e","original_commit_id":"537b1e318222221a9033e48290e266996b4e3a2e","user":{"login":"sduenas","id":833352,"avatar_url":"https://avatars.githubusercontent.com/u/833352?v=3","gravatar_id":"","url":"https://api.github.com/users/sduenas","html_url":"https://github.com/sduenas","followers_url":"https://api.github.com/users/sduenas/followers","following_url":"https://api.github.com/users/sduenas/following{/other_user}","gists_url":"https://api.github.com/users/sduenas/gists{/gist_id}","starred_url":"https://api.github.com/users/sduenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sduenas/subscriptions","organizations_url":"https://api.github.com/users/sduenas/orgs","repos_url":"https://api.github.com/users/sduenas/repos","events_url":"https://api.github.com/users/sduenas/events{/privacy}","received_events_url":"https://api.github.com/users/sduenas/received_events","type":"User","site_admin":false},"body":"This method can go outside of this class.","created_at":"2016-12-12T17:22:39Z","updated_at":"2016-12-12T17:22:39Z","html_url":"https://github.com/grimoirelab/perceval/pull/98#discussion_r91995013","pull_request_url":"https://api.github.com/repos/grimoirelab/perceval/pulls/98","_links":{"self":{"href":"https://api.github.com/repos/grimoirelab/perceval/pulls/comments/91995013"},"html":{"href":"https://github.com/grimoirelab/perceval/pull/98#discussion_r91995013"},"pull_request":{"href":"https://api.github.com/repos/grimoirelab/perceval/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/grimoirelab/perceval/pulls/98","id":97058996,"html_url":"https://github.com/grimoirelab/perceval/pull/98","diff_url":"https://github.com/grimoirelab/perceval/pull/98.diff","patch_url":"https://github.com/grimoirelab/perceval/pull/98.patch","issue_url":"https://api.github.com/repos/grimoirelab/perceval/issues/98","number":98,"state":"open","locked":false,"title":"Initial RSS backend for perceval","user":{"login":"acs","id":209533,"avatar_url":"https://avatars.githubusercontent.com/u/209533?v=3","gravatar_id":"","url":"https://api.github.com/users/acs","html_url":"https://github.com/acs","followers_url":"https://api.github.com/users/acs/followers","following_url":"https://api.github.com/users/acs/following{/other_user}","gists_url":"https://api.github.com/users/acs/gists{/gist_id}","starred_url":"https://api.github.com/users/acs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acs/subscriptions","organizations_url":"https://api.github.com/users/acs/orgs","repos_url":"https://api.github.com/users/acs/repos","events_url":"https://api.github.com/users/acs/events{/privacy}","received_events_url":"https://api.github.com/users/acs/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-08T04:53:00Z","updated_at":"2016-12-12T17:50:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1b948700e5c983846f324edc33e3376bb372164","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/grimoirelab/perceval/pulls/98/commits","review_comments_url":"https://api.github.com/repos/grimoirelab/perceval/pulls/98/comments","review_comment_url":"https://api.github.com/repos/grimoirelab/perceval/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grimoirelab/perceval/issues/98/comments","statuses_url":"https://api.github.com/repos/grimoirelab/perceval/statuses/537b1e318222221a9033e48290e266996b4e3a2e","head":{"label":"acs:rss","ref":"rss","sha":"537b1e318222221a9033e48290e266996b4e3a2e","user":{"login":"acs","id":209533,"avatar_url":"https://avatars.githubusercontent.com/u/209533?v=3","gravatar_id":"","url":"https://api.github.com/users/acs","html_url":"https://github.com/acs","followers_url":"https://api.github.com/users/acs/followers","following_url":"https://api.github.com/users/acs/following{/other_user}","gists_url":"https://api.github.com/users/acs/gists{/gist_id}","starred_url":"https://api.github.com/users/acs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acs/subscriptions","organizations_url":"https://api.github.com/users/acs/orgs","repos_url":"https://api.github.com/users/acs/repos","events_url":"https://api.github.com/users/acs/events{/privacy}","received_events_url":"https://api.github.com/users/acs/received_events","type":"User","site_admin":false},"repo":{"id":47419452,"name":"perceval","full_name":"acs/perceval","owner":{"login":"acs","id":209533,"avatar_url":"https://avatars.githubusercontent.com/u/209533?v=3","gravatar_id":"","url":"https://api.github.com/users/acs","html_url":"https://github.com/acs","followers_url":"https://api.github.com/users/acs/followers","following_url":"https://api.github.com/users/acs/following{/other_user}","gists_url":"https://api.github.com/users/acs/gists{/gist_id}","starred_url":"https://api.github.com/users/acs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acs/subscriptions","organizations_url":"https://api.github.com/users/acs/orgs","repos_url":"https://api.github.com/users/acs/repos","events_url":"https://api.github.com/users/acs/events{/privacy}","received_events_url":"https://api.github.com/users/acs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acs/perceval","description":"Send Sir Perceval on a quest to retrieve and gather data from software repositories.","fork":true,"url":"https://api.github.com/repos/acs/perceval","forks_url":"https://api.github.com/repos/acs/perceval/forks","keys_url":"https://api.github.com/repos/acs/perceval/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acs/perceval/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acs/perceval/teams","hooks_url":"https://api.github.com/repos/acs/perceval/hooks","issue_events_url":"https://api.github.com/repos/acs/perceval/issues/events{/number}","events_url":"https://api.github.com/repos/acs/perceval/events","assignees_url":"https://api.github.com/repos/acs/perceval/assignees{/user}","branches_url":"https://api.github.com/repos/acs/perceval/branches{/branch}","tags_url":"https://api.github.com/repos/acs/perceval/tags","blobs_url":"https://api.github.com/repos/acs/perceval/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acs/perceval/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acs/perceval/git/refs{/sha}","trees_url":"https://api.github.com/repos/acs/perceval/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acs/perceval/statuses/{sha}","languages_url":"https://api.github.com/repos/acs/perceval/languages","stargazers_url":"https://api.github.com/repos/acs/perceval/stargazers","contributors_url":"https://api.github.com/repos/acs/perceval/contributors","subscribers_url":"https://api.github.com/repos/acs/perceval/subscribers","subscription_url":"https://api.github.com/repos/acs/perceval/subscription","commits_url":"https://api.github.com/repos/acs/perceval/commits{/sha}","git_commits_url":"https://api.github.com/repos/acs/perceval/git/commits{/sha}","comments_url":"https://api.github.com/repos/acs/perceval/comments{/number}","issue_comment_url":"https://api.github.com/repos/acs/perceval/issues/comments{/number}","contents_url":"https://api.github.com/repos/acs/perceval/contents/{+path}","compare_url":"https://api.github.com/repos/acs/perceval/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acs/perceval/merges","archive_url":"https://api.github.com/repos/acs/perceval/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acs/perceval/downloads","issues_url":"https://api.github.com/repos/acs/perceval/issues{/number}","pulls_url":"https://api.github.com/repos/acs/perceval/pulls{/number}","milestones_url":"https://api.github.com/repos/acs/perceval/milestones{/number}","notifications_url":"https://api.github.com/repos/acs/perceval/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acs/perceval/labels{/name}","releases_url":"https://api.github.com/repos/acs/perceval/releases{/id}","deployments_url":"https://api.github.com/repos/acs/perceval/deployments","created_at":"2015-12-04T17:36:17Z","updated_at":"2016-12-08T03:58:34Z","pushed_at":"2016-12-08T05:56:09Z","git_url":"git://github.com/acs/perceval.git","ssh_url":"git@github.com:acs/perceval.git","clone_url":"https://github.com/acs/perceval.git","svn_url":"https://github.com/acs/perceval","homepage":null,"size":1110,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"grimoirelab:master","ref":"master","sha":"9476eaff229d24812179509bf5dac652f45cfaf8","user":{"login":"grimoirelab","id":16151805,"avatar_url":"https://avatars.githubusercontent.com/u/16151805?v=3","gravatar_id":"","url":"https://api.github.com/users/grimoirelab","html_url":"https://github.com/grimoirelab","followers_url":"https://api.github.com/users/grimoirelab/followers","following_url":"https://api.github.com/users/grimoirelab/following{/other_user}","gists_url":"https://api.github.com/users/grimoirelab/gists{/gist_id}","starred_url":"https://api.github.com/users/grimoirelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grimoirelab/subscriptions","organizations_url":"https://api.github.com/users/grimoirelab/orgs","repos_url":"https://api.github.com/users/grimoirelab/repos","events_url":"https://api.github.com/users/grimoirelab/events{/privacy}","received_events_url":"https://api.github.com/users/grimoirelab/received_events","type":"Organization","site_admin":false},"repo":{"id":47415120,"name":"perceval","full_name":"grimoirelab/perceval","owner":{"login":"grimoirelab","id":16151805,"avatar_url":"https://avatars.githubusercontent.com/u/16151805?v=3","gravatar_id":"","url":"https://api.github.com/users/grimoirelab","html_url":"https://github.com/grimoirelab","followers_url":"https://api.github.com/users/grimoirelab/followers","following_url":"https://api.github.com/users/grimoirelab/following{/other_user}","gists_url":"https://api.github.com/users/grimoirelab/gists{/gist_id}","starred_url":"https://api.github.com/users/grimoirelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grimoirelab/subscriptions","organizations_url":"https://api.github.com/users/grimoirelab/orgs","repos_url":"https://api.github.com/users/grimoirelab/repos","events_url":"https://api.github.com/users/grimoirelab/events{/privacy}","received_events_url":"https://api.github.com/users/grimoirelab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grimoirelab/perceval","description":"Send Sir Perceval on a quest to retrieve and gather data from software repositories.","fork":false,"url":"https://api.github.com/repos/grimoirelab/perceval","forks_url":"https://api.github.com/repos/grimoirelab/perceval/forks","keys_url":"https://api.github.com/repos/grimoirelab/perceval/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grimoirelab/perceval/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grimoirelab/perceval/teams","hooks_url":"https://api.github.com/repos/grimoirelab/perceval/hooks","issue_events_url":"https://api.github.com/repos/grimoirelab/perceval/issues/events{/number}","events_url":"https://api.github.com/repos/grimoirelab/perceval/events","assignees_url":"https://api.github.com/repos/grimoirelab/perceval/assignees{/user}","branches_url":"https://api.github.com/repos/grimoirelab/perceval/branches{/branch}","tags_url":"https://api.github.com/repos/grimoirelab/perceval/tags","blobs_url":"https://api.github.com/repos/grimoirelab/perceval/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grimoirelab/perceval/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grimoirelab/perceval/git/refs{/sha}","trees_url":"https://api.github.com/repos/grimoirelab/perceval/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grimoirelab/perceval/statuses/{sha}","languages_url":"https://api.github.com/repos/grimoirelab/perceval/languages","stargazers_url":"https://api.github.com/repos/grimoirelab/perceval/stargazers","contributors_url":"https://api.github.com/repos/grimoirelab/perceval/contributors","subscribers_url":"https://api.github.com/repos/grimoirelab/perceval/subscribers","subscription_url":"https://api.github.com/repos/grimoirelab/perceval/subscription","commits_url":"https://api.github.com/repos/grimoirelab/perceval/commits{/sha}","git_commits_url":"https://api.github.com/repos/grimoirelab/perceval/git/commits{/sha}","comments_url":"https://api.github.com/repos/grimoirelab/perceval/comments{/number}","issue_comment_url":"https://api.github.com/repos/grimoirelab/perceval/issues/comments{/number}","contents_url":"https://api.github.com/repos/grimoirelab/perceval/contents/{+path}","compare_url":"https://api.github.com/repos/grimoirelab/perceval/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grimoirelab/perceval/merges","archive_url":"https://api.github.com/repos/grimoirelab/perceval/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grimoirelab/perceval/downloads","issues_url":"https://api.github.com/repos/grimoirelab/perceval/issues{/number}","pulls_url":"https://api.github.com/repos/grimoirelab/perceval/pulls{/number}","milestones_url":"https://api.github.com/repos/grimoirelab/perceval/milestones{/number}","notifications_url":"https://api.github.com/repos/grimoirelab/perceval/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grimoirelab/perceval/labels{/name}","releases_url":"https://api.github.com/repos/grimoirelab/perceval/releases{/id}","deployments_url":"https://api.github.com/repos/grimoirelab/perceval/deployments","created_at":"2015-12-04T16:20:11Z","updated_at":"2016-11-25T12:37:41Z","pushed_at":"2016-12-08T05:56:09Z","git_url":"git://github.com/grimoirelab/perceval.git","ssh_url":"git@github.com:grimoirelab/perceval.git","clone_url":"https://github.com/grimoirelab/perceval.git","svn_url":"https://github.com/grimoirelab/perceval","homepage":null,"size":1392,"stargazers_count":29,"watchers_count":29,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":19,"forks":15,"open_issues":19,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grimoirelab/perceval/pulls/98"},"html":{"href":"https://github.com/grimoirelab/perceval/pull/98"},"issue":{"href":"https://api.github.com/repos/grimoirelab/perceval/issues/98"},"comments":{"href":"https://api.github.com/repos/grimoirelab/perceval/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/grimoirelab/perceval/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/grimoirelab/perceval/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grimoirelab/perceval/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/grimoirelab/perceval/statuses/537b1e318222221a9033e48290e266996b4e3a2e"}}}}
{"actor":{"display_login":"sduenas"}}