{"action":"created","comment":{"url":"https://api.github.com/repos/lsst/ctrl_events/pulls/comments/26169559","id":26169559,"diff_hunk":"@@ -0,0 +1,123 @@\n+#!/usr/bin/env python\n+\n+# \n+# LSST Data Management System\n+#\n+# Copyright 2008-2014  AURA/LSST.\n+# \n+# This product includes software developed by the\n+# LSST Project (http://www.lsst.org/).\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 LSST License Statement and \n+# the GNU General Public License along with this program.  If not, \n+# see <https://www.lsstcorp.org/LegalNotices/>.\n+#\n+\n+import unittest\n+\n+import os\n+import platform\n+import time\n+import lsst.ctrl.events as events\n+from lsst.daf.base import PropertySet\n+\n+#\n+# Send an event\n+#\n+class CombinedReceiveEventTestCase(unittest.TestCase):\n+\n+    def sendEvent(self, broker, topic):\n+        trans = events.EventTransmitter(broker, topic)\n+        \n+        root = PropertySet()\n+        root.set(\"TOPIC\",topic)\n+        root.set(\"myname\",\"myname\")\n+        root.set(\"STATUS\", \"my special status\")\n+        root.set(\"RUNID\",\"srptestrun\")\n+        \n+        event = events.Event(\"srptestrun\", root)\n+    \n+        # wait a short time so we can see the difference between the time \n+        # the event is created and the time it is published\n+        time.sleep(2)\n+    \n+        # ok...now publish it\n+        trans.publishEvent(event)\n+\n+    def testCombinedReceive(self):\n+        # Test sending on two topics, and receiving bother on a third.\n+        #\n+        broker = \"lsst8.ncsa.illinois.edu\"\n+        host = platform.node()\n+        pid = os.getpid()\n+        host_pid = \"%s_%d\" % (host,pid)\n+    \n+        topicA = \"test_events_9_%s.A\" % host_pid\n+        topicB = \"test_events_9_%s.B\" % host_pid\n+        topicC = \"test_events_9_%s.*\" % host_pid\n+    \n+        recvA = events.EventReceiver(broker, topicA)\n+        recvB = events.EventReceiver(broker, topicB)\n+        recvC = events.EventReceiver(broker, topicC)\n+    \n+        # send a test event on topicA and topicB\n+        self.sendEvent(broker, topicA)\n+        self.sendEvent(broker, topicB)\n+\n+        # receive event on topicA, and check to see it's the\n+        # right one\n+        val = recvA.receiveEvent()\n+        self.assertNotEqual(val, None)\n+        ps = val.getPropertySet()\n+        name = ps.get(\"TOPIC\")\n+        self.assertEqual(name, topicA)\n+\n+        # receiving no more messages on topicA\n+        val = recvA.receiveEvent(1)\n+        self.assertEqual(val, None)\n+\n+        # receive event on topicB, and check to see it's the\n+        # right one\n+        val = recvB.receiveEvent()\n+        self.assertNotEqual(val, None)\n+        ps = val.getPropertySet()\n+        name = ps.get(\"TOPIC\")\n+        self.assertEqual(name, topicB)\n+\n+        # receiving no more messages on topicB\n+        val = recvB.receiveEvent(1)\n+        self.assertEqual(val, None)\n+    \n+        # receive event on topicC, and check to see it's\n+        # the one sent to topicA\n+        val = recvC.receiveEvent()\n+        self.assertNotEqual(val, None)\n+        ps = val.getPropertySet()\n+        name = ps.get(\"TOPIC\")\n+        self.assertEqual(name, topicA)\n+    \n+        # receive event on topicC, and check to see it's\n+        # the one sent to topicB\n+        val = recvC.receiveEvent()\n+        self.assertNotEqual(val, None)\n+        ps = val.getPropertySet()\n+        name = ps.get(\"TOPIC\")\n+        self.assertEqual(name, topicB)\n+\n+        # receiving no more messages on topicC\n+        val = recvC.receiveEvent(1)\n+        self.assertEqual(val, None)\n+    \n+\n+if __name__ == \"__main__\":","path":"tests/CombinedReceive.py","position":122,"original_position":122,"commit_id":"166f5a4b8273fa349f3c1bdff7f62de488ce7373","original_commit_id":"772942c2069c3043f3c6536f584a1290312ee56f","user":{"login":"srp3rd","id":8494530,"avatar_url":"https://avatars.githubusercontent.com/u/8494530?v=3","gravatar_id":"","url":"https://api.github.com/users/srp3rd","html_url":"https://github.com/srp3rd","followers_url":"https://api.github.com/users/srp3rd/followers","following_url":"https://api.github.com/users/srp3rd/following{/other_user}","gists_url":"https://api.github.com/users/srp3rd/gists{/gist_id}","starred_url":"https://api.github.com/users/srp3rd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srp3rd/subscriptions","organizations_url":"https://api.github.com/users/srp3rd/orgs","repos_url":"https://api.github.com/users/srp3rd/repos","events_url":"https://api.github.com/users/srp3rd/events{/privacy}","received_events_url":"https://api.github.com/users/srp3rd/received_events","type":"User","site_admin":false},"body":"I don't know what you're referring to here.  Can I get a pointer to it?","created_at":"2015-03-10T21:45:30Z","updated_at":"2015-03-10T21:45:30Z","html_url":"https://github.com/lsst/ctrl_events/pull/1#discussion_r26169559","pull_request_url":"https://api.github.com/repos/lsst/ctrl_events/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/lsst/ctrl_events/pulls/comments/26169559"},"html":{"href":"https://github.com/lsst/ctrl_events/pull/1#discussion_r26169559"},"pull_request":{"href":"https://api.github.com/repos/lsst/ctrl_events/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/lsst/ctrl_events/pulls/1","id":29554159,"html_url":"https://github.com/lsst/ctrl_events/pull/1","diff_url":"https://github.com/lsst/ctrl_events/pull/1.diff","patch_url":"https://github.com/lsst/ctrl_events/pull/1.patch","issue_url":"https://api.github.com/repos/lsst/ctrl_events/issues/1","number":1,"state":"open","locked":false,"title":"DM-1350: General cleanup of Events package","user":{"login":"PaulPrice","id":1334980,"avatar_url":"https://avatars.githubusercontent.com/u/1334980?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulPrice","html_url":"https://github.com/PaulPrice","followers_url":"https://api.github.com/users/PaulPrice/followers","following_url":"https://api.github.com/users/PaulPrice/following{/other_user}","gists_url":"https://api.github.com/users/PaulPrice/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulPrice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulPrice/subscriptions","organizations_url":"https://api.github.com/users/PaulPrice/orgs","repos_url":"https://api.github.com/users/PaulPrice/repos","events_url":"https://api.github.com/users/PaulPrice/events{/privacy}","received_events_url":"https://api.github.com/users/PaulPrice/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-18T19:19:13Z","updated_at":"2015-03-10T21:45:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5d960e6159b8bea78bcd0945f9bdfd3485bdb22","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lsst/ctrl_events/pulls/1/commits","review_comments_url":"https://api.github.com/repos/lsst/ctrl_events/pulls/1/comments","review_comment_url":"https://api.github.com/repos/lsst/ctrl_events/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst/ctrl_events/issues/1/comments","statuses_url":"https://api.github.com/repos/lsst/ctrl_events/statuses/166f5a4b8273fa349f3c1bdff7f62de488ce7373","head":{"label":"lsst:tickets/DM-1350","ref":"tickets/DM-1350","sha":"166f5a4b8273fa349f3c1bdff7f62de488ce7373","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":23013228,"name":"ctrl_events","full_name":"lsst/ctrl_events","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/ctrl_events","description":"LSST Data Management events messaging","fork":false,"url":"https://api.github.com/repos/lsst/ctrl_events","forks_url":"https://api.github.com/repos/lsst/ctrl_events/forks","keys_url":"https://api.github.com/repos/lsst/ctrl_events/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/ctrl_events/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/ctrl_events/teams","hooks_url":"https://api.github.com/repos/lsst/ctrl_events/hooks","issue_events_url":"https://api.github.com/repos/lsst/ctrl_events/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/ctrl_events/events","assignees_url":"https://api.github.com/repos/lsst/ctrl_events/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/ctrl_events/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/ctrl_events/tags","blobs_url":"https://api.github.com/repos/lsst/ctrl_events/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/ctrl_events/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/ctrl_events/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/ctrl_events/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/ctrl_events/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/ctrl_events/languages","stargazers_url":"https://api.github.com/repos/lsst/ctrl_events/stargazers","contributors_url":"https://api.github.com/repos/lsst/ctrl_events/contributors","subscribers_url":"https://api.github.com/repos/lsst/ctrl_events/subscribers","subscription_url":"https://api.github.com/repos/lsst/ctrl_events/subscription","commits_url":"https://api.github.com/repos/lsst/ctrl_events/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/ctrl_events/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/ctrl_events/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/ctrl_events/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/ctrl_events/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/ctrl_events/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/ctrl_events/merges","archive_url":"https://api.github.com/repos/lsst/ctrl_events/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/ctrl_events/downloads","issues_url":"https://api.github.com/repos/lsst/ctrl_events/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/ctrl_events/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/ctrl_events/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/ctrl_events/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/ctrl_events/labels{/name}","releases_url":"https://api.github.com/repos/lsst/ctrl_events/releases{/id}","created_at":"2014-08-16T07:40:03Z","updated_at":"2015-02-13T00:18:08Z","pushed_at":"2015-03-10T21:41:32Z","git_url":"git://github.com/lsst/ctrl_events.git","ssh_url":"git@github.com:lsst/ctrl_events.git","clone_url":"https://github.com/lsst/ctrl_events.git","svn_url":"https://github.com/lsst/ctrl_events","homepage":"http://dm.lsst.org","size":1332,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lsst:master","ref":"master","sha":"6f35c86b98231a851b69c79236eab6af8920daa5","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":23013228,"name":"ctrl_events","full_name":"lsst/ctrl_events","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/ctrl_events","description":"LSST Data Management events messaging","fork":false,"url":"https://api.github.com/repos/lsst/ctrl_events","forks_url":"https://api.github.com/repos/lsst/ctrl_events/forks","keys_url":"https://api.github.com/repos/lsst/ctrl_events/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/ctrl_events/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/ctrl_events/teams","hooks_url":"https://api.github.com/repos/lsst/ctrl_events/hooks","issue_events_url":"https://api.github.com/repos/lsst/ctrl_events/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/ctrl_events/events","assignees_url":"https://api.github.com/repos/lsst/ctrl_events/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/ctrl_events/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/ctrl_events/tags","blobs_url":"https://api.github.com/repos/lsst/ctrl_events/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/ctrl_events/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/ctrl_events/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/ctrl_events/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/ctrl_events/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/ctrl_events/languages","stargazers_url":"https://api.github.com/repos/lsst/ctrl_events/stargazers","contributors_url":"https://api.github.com/repos/lsst/ctrl_events/contributors","subscribers_url":"https://api.github.com/repos/lsst/ctrl_events/subscribers","subscription_url":"https://api.github.com/repos/lsst/ctrl_events/subscription","commits_url":"https://api.github.com/repos/lsst/ctrl_events/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/ctrl_events/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/ctrl_events/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/ctrl_events/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/ctrl_events/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/ctrl_events/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/ctrl_events/merges","archive_url":"https://api.github.com/repos/lsst/ctrl_events/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/ctrl_events/downloads","issues_url":"https://api.github.com/repos/lsst/ctrl_events/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/ctrl_events/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/ctrl_events/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/ctrl_events/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/ctrl_events/labels{/name}","releases_url":"https://api.github.com/repos/lsst/ctrl_events/releases{/id}","created_at":"2014-08-16T07:40:03Z","updated_at":"2015-02-13T00:18:08Z","pushed_at":"2015-03-10T21:41:32Z","git_url":"git://github.com/lsst/ctrl_events.git","ssh_url":"git@github.com:lsst/ctrl_events.git","clone_url":"https://github.com/lsst/ctrl_events.git","svn_url":"https://github.com/lsst/ctrl_events","homepage":"http://dm.lsst.org","size":1332,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst/ctrl_events/pulls/1"},"html":{"href":"https://github.com/lsst/ctrl_events/pull/1"},"issue":{"href":"https://api.github.com/repos/lsst/ctrl_events/issues/1"},"comments":{"href":"https://api.github.com/repos/lsst/ctrl_events/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst/ctrl_events/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst/ctrl_events/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst/ctrl_events/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/lsst/ctrl_events/statuses/166f5a4b8273fa349f3c1bdff7f62de488ce7373"}}}}