{"action":"created","comment":{"url":"https://api.github.com/repos/indico/indico-plugins/pulls/comments/74241008","id":74241008,"diff_hunk":"@@ -0,0 +1,57 @@\n+# This file is part of Indico.\n+# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).\n+#\n+# Indico is free software; you can redistribute it and/or\n+# modify it under the terms of the GNU General Public License as\n+# published by the Free Software Foundation; either version 3 of the\n+# License, or (at your option) any later version.\n+#\n+# Indico is distributed in the hope that it will be useful, but\n+# WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+# General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with Indico; if not, see <http://www.gnu.org/licenses/>.\n+\n+\n+from indico_livesync.util import get_excluded_categories, obj_ref\n+from indico_livesync.models.queue import LiveSyncQueueEntry, ChangeType\n+\n+\n+CATEGORY_PARENTS = {\n+    0: None,\n+    1: 0,\n+    2: 0,\n+    3: 2,\n+    4: 3,\n+    5: 3\n+}\n+\n+\n+def test_excluded_categories(mocker, monkeypatch, db, create_category, dummy_agent):\n+    \"\"\"Test if category exclusions work\"\"\"\n+\n+    # IMPORTANT: `dummy_agent` is actually needed here, since ``LiveSyncQueueEntry.create``\n+    # will look for all existing agents in the DB. `db.session.add` is not necessary but\n+    # it keeps static checkers happy.\n+    db.session.add(dummy_agent)","path":"livesync/tests/queue_test.py","position":38,"original_position":38,"commit_id":"939ccba844fd69c96d2d5515c73ee360223a5826","original_commit_id":"5f465a432ef04210a362a62244a2936143fc7225","user":{"login":"pferreir","id":2699,"avatar_url":"https://avatars.githubusercontent.com/u/2699?v=3","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"body":"Yeah, I didn't think of that. I had seen it before.","created_at":"2016-08-10T13:15:53Z","updated_at":"2016-08-10T13:15:53Z","html_url":"https://github.com/indico/indico-plugins/pull/32#discussion_r74241008","pull_request_url":"https://api.github.com/repos/indico/indico-plugins/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/comments/74241008"},"html":{"href":"https://github.com/indico/indico-plugins/pull/32#discussion_r74241008"},"pull_request":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/indico/indico-plugins/pulls/32","id":78319381,"html_url":"https://github.com/indico/indico-plugins/pull/32","diff_url":"https://github.com/indico/indico-plugins/pull/32.diff","patch_url":"https://github.com/indico/indico-plugins/pull/32.patch","issue_url":"https://api.github.com/repos/indico/indico-plugins/issues/32","number":32,"state":"open","locked":false,"title":"LiveSync - link to categories and sessions","user":{"login":"pferreir","id":2699,"avatar_url":"https://avatars.githubusercontent.com/u/2699?v=3","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"body":"Simplified the way records are processed.\r\n\r\nSee also https://github.com/indico/indico/pull/2545.\r\n\r\nMissing:\r\n* [x] Unit tests (need some dummy DB objects)\r\n* [x] Checking that Invenio/CERN plugins work fine\r\n* [x] Some extra smoke testing (handling deletes, etc...)","created_at":"2016-07-21T13:52:17Z","updated_at":"2016-08-10T13:15:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41e374599e584b83a0095cd8f48dbb511a046515","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/indico/indico-plugins/pulls/32/commits","review_comments_url":"https://api.github.com/repos/indico/indico-plugins/pulls/32/comments","review_comment_url":"https://api.github.com/repos/indico/indico-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/indico/indico-plugins/issues/32/comments","statuses_url":"https://api.github.com/repos/indico/indico-plugins/statuses/939ccba844fd69c96d2d5515c73ee360223a5826","head":{"label":"pferreir:wip/livesync-categories","ref":"wip/livesync-categories","sha":"939ccba844fd69c96d2d5515c73ee360223a5826","user":{"login":"pferreir","id":2699,"avatar_url":"https://avatars.githubusercontent.com/u/2699?v=3","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"repo":{"id":30872861,"name":"indico-plugins","full_name":"pferreir/indico-plugins","owner":{"login":"pferreir","id":2699,"avatar_url":"https://avatars.githubusercontent.com/u/2699?v=3","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pferreir/indico-plugins","description":"Indico plugins developed by the Indico team","fork":true,"url":"https://api.github.com/repos/pferreir/indico-plugins","forks_url":"https://api.github.com/repos/pferreir/indico-plugins/forks","keys_url":"https://api.github.com/repos/pferreir/indico-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pferreir/indico-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pferreir/indico-plugins/teams","hooks_url":"https://api.github.com/repos/pferreir/indico-plugins/hooks","issue_events_url":"https://api.github.com/repos/pferreir/indico-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/pferreir/indico-plugins/events","assignees_url":"https://api.github.com/repos/pferreir/indico-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/pferreir/indico-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/pferreir/indico-plugins/tags","blobs_url":"https://api.github.com/repos/pferreir/indico-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pferreir/indico-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pferreir/indico-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/pferreir/indico-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pferreir/indico-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/pferreir/indico-plugins/languages","stargazers_url":"https://api.github.com/repos/pferreir/indico-plugins/stargazers","contributors_url":"https://api.github.com/repos/pferreir/indico-plugins/contributors","subscribers_url":"https://api.github.com/repos/pferreir/indico-plugins/subscribers","subscription_url":"https://api.github.com/repos/pferreir/indico-plugins/subscription","commits_url":"https://api.github.com/repos/pferreir/indico-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/pferreir/indico-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/pferreir/indico-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/pferreir/indico-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/pferreir/indico-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/pferreir/indico-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pferreir/indico-plugins/merges","archive_url":"https://api.github.com/repos/pferreir/indico-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pferreir/indico-plugins/downloads","issues_url":"https://api.github.com/repos/pferreir/indico-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/pferreir/indico-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/pferreir/indico-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/pferreir/indico-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pferreir/indico-plugins/labels{/name}","releases_url":"https://api.github.com/repos/pferreir/indico-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/pferreir/indico-plugins/deployments","created_at":"2015-02-16T14:54:36Z","updated_at":"2015-03-11T18:04:40Z","pushed_at":"2016-08-09T09:45:09Z","git_url":"git://github.com/pferreir/indico-plugins.git","ssh_url":"git@github.com:pferreir/indico-plugins.git","clone_url":"https://github.com/pferreir/indico-plugins.git","svn_url":"https://github.com/pferreir/indico-plugins","homepage":null,"size":2875,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"indico:devel","ref":"devel","sha":"4505f780241e7b11bc8cdae64cefb57d77a446d8","user":{"login":"indico","id":715236,"avatar_url":"https://avatars.githubusercontent.com/u/715236?v=3","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"repo":{"id":26865883,"name":"indico-plugins","full_name":"indico/indico-plugins","owner":{"login":"indico","id":715236,"avatar_url":"https://avatars.githubusercontent.com/u/715236?v=3","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/indico/indico-plugins","description":"Indico plugins developed by the Indico team","fork":false,"url":"https://api.github.com/repos/indico/indico-plugins","forks_url":"https://api.github.com/repos/indico/indico-plugins/forks","keys_url":"https://api.github.com/repos/indico/indico-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/indico/indico-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/indico/indico-plugins/teams","hooks_url":"https://api.github.com/repos/indico/indico-plugins/hooks","issue_events_url":"https://api.github.com/repos/indico/indico-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/indico/indico-plugins/events","assignees_url":"https://api.github.com/repos/indico/indico-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/indico/indico-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/indico/indico-plugins/tags","blobs_url":"https://api.github.com/repos/indico/indico-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/indico/indico-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/indico/indico-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/indico/indico-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/indico/indico-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/indico/indico-plugins/languages","stargazers_url":"https://api.github.com/repos/indico/indico-plugins/stargazers","contributors_url":"https://api.github.com/repos/indico/indico-plugins/contributors","subscribers_url":"https://api.github.com/repos/indico/indico-plugins/subscribers","subscription_url":"https://api.github.com/repos/indico/indico-plugins/subscription","commits_url":"https://api.github.com/repos/indico/indico-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/indico/indico-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/indico/indico-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/indico/indico-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/indico/indico-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/indico/indico-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/indico/indico-plugins/merges","archive_url":"https://api.github.com/repos/indico/indico-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/indico/indico-plugins/downloads","issues_url":"https://api.github.com/repos/indico/indico-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/indico/indico-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/indico/indico-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/indico/indico-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/indico/indico-plugins/labels{/name}","releases_url":"https://api.github.com/repos/indico/indico-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/indico/indico-plugins/deployments","created_at":"2014-11-19T14:48:42Z","updated_at":"2016-01-25T12:35:01Z","pushed_at":"2016-08-09T09:45:11Z","git_url":"git://github.com/indico/indico-plugins.git","ssh_url":"git@github.com:indico/indico-plugins.git","clone_url":"https://github.com/indico/indico-plugins.git","svn_url":"https://github.com/indico/indico-plugins","homepage":null,"size":2897,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":9,"forks":7,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/32"},"html":{"href":"https://github.com/indico/indico-plugins/pull/32"},"issue":{"href":"https://api.github.com/repos/indico/indico-plugins/issues/32"},"comments":{"href":"https://api.github.com/repos/indico/indico-plugins/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/indico/indico-plugins/statuses/939ccba844fd69c96d2d5515c73ee360223a5826"}}}}
{"actor":{"display_login":"pferreir"}}