{"action":"created","comment":{"url":"https://api.github.com/repos/pysb/pysb/pulls/comments/40432489","id":40432489,"diff_hunk":"@@ -0,0 +1,41 @@\n+from pysb.core import *\n+from pysb.util import *\n+from pysb.examples import earm_1_0\n+\n+\n+def test_alias_model_components():\n+    \"\"\"\n+    Tests that alias_model_components() exports to the global namespace\n+    \"\"\"\n+    m = Model(_export=False)\n+    m.add_component(Monomer('temp_monomer_A', _export=False))\n+    try:\n+        temp_monomer_A\n+        raise NameError('Monomer A should not be defined in global namespace')\n+    except NameError:\n+        # We expect this exception due to _export=False\n+        pass\n+    alias_model_components(m)\n+\n+    # Use global version of temp_monomer_A (needed to delete it)\n+    global temp_monomer_A\n+\n+    # A should now be defined in the namespace - try deleting it\n+    assert isinstance(temp_monomer_A, Monomer)\n+\n+    # Delete the monomer to cleanup the global namespace\n+    del temp_monomer_A\n+\n+\n+def test_rules_using_parameter():\n+    \"\"\"\n+    Tests for rules_using_parameter() in pysb.util\n+    \"\"\"\n+    # Get rules matching parameter name\n+    r = rules_using_parameter(earm_1_0.model, 'kc1')\n+    assert isinstance(r.get('produce_DISC'), Rule)\n+\n+    # Get rules by supplying Parameter object directly\n+    r = rules_using_parameter(earm_1_0.model,\n+                              earm_1_0.model.parameters.get('kc1'))\n+    assert isinstance(r.get('produce_DISC'), Rule)","path":"pysb/tests/test_util.py","position":41,"original_position":41,"commit_id":"e7e96679bee4fa2d0156377d40c6fa4d2918b21f","original_commit_id":"e7e96679bee4fa2d0156377d40c6fa4d2918b21f","user":{"login":"jmuhlich","id":277154,"avatar_url":"https://avatars.githubusercontent.com/u/277154?v=3","gravatar_id":"","url":"https://api.github.com/users/jmuhlich","html_url":"https://github.com/jmuhlich","followers_url":"https://api.github.com/users/jmuhlich/followers","following_url":"https://api.github.com/users/jmuhlich/following{/other_user}","gists_url":"https://api.github.com/users/jmuhlich/gists{/gist_id}","starred_url":"https://api.github.com/users/jmuhlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmuhlich/subscriptions","organizations_url":"https://api.github.com/users/jmuhlich/orgs","repos_url":"https://api.github.com/users/jmuhlich/repos","events_url":"https://api.github.com/users/jmuhlich/events{/privacy}","received_events_url":"https://api.github.com/users/jmuhlich/received_events","type":"User","site_admin":false},"body":"Your editor seems to be stripping the newline at the end of files. I've seen this on a bunch of other files in your PRs, both new files and existing ones that were edited. Can you check on that and disable it, and fix the files touched in this PR?","created_at":"2015-09-25T14:05:19Z","updated_at":"2015-09-25T14:05:19Z","html_url":"https://github.com/pysb/pysb/pull/159#discussion_r40432489","pull_request_url":"https://api.github.com/repos/pysb/pysb/pulls/159","_links":{"self":{"href":"https://api.github.com/repos/pysb/pysb/pulls/comments/40432489"},"html":{"href":"https://github.com/pysb/pysb/pull/159#discussion_r40432489"},"pull_request":{"href":"https://api.github.com/repos/pysb/pysb/pulls/159"}}},"pull_request":{"url":"https://api.github.com/repos/pysb/pysb/pulls/159","id":45964553,"html_url":"https://github.com/pysb/pysb/pull/159","diff_url":"https://github.com/pysb/pysb/pull/159.diff","patch_url":"https://github.com/pysb/pysb/pull/159.patch","issue_url":"https://api.github.com/repos/pysb/pysb/issues/159","number":159,"state":"open","locked":false,"title":"Unit tests for pysb/util.py (only exported functions)","user":{"login":"alubbock","id":2590257,"avatar_url":"https://avatars.githubusercontent.com/u/2590257?v=3","gravatar_id":"","url":"https://api.github.com/users/alubbock","html_url":"https://github.com/alubbock","followers_url":"https://api.github.com/users/alubbock/followers","following_url":"https://api.github.com/users/alubbock/following{/other_user}","gists_url":"https://api.github.com/users/alubbock/gists{/gist_id}","starred_url":"https://api.github.com/users/alubbock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alubbock/subscriptions","organizations_url":"https://api.github.com/users/alubbock/orgs","repos_url":"https://api.github.com/users/alubbock/repos","events_url":"https://api.github.com/users/alubbock/events{/privacy}","received_events_url":"https://api.github.com/users/alubbock/received_events","type":"User","site_admin":false},"body":"Closes #158. Only the two exported functions -- `alias_model_components` and `rules_using_parameter` -- are tested for now.","created_at":"2015-09-25T00:02:54Z","updated_at":"2015-09-25T14:05:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a57b2eb2ccee6ea98056ae6038bf6de130b7b82c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pysb/pysb/pulls/159/commits","review_comments_url":"https://api.github.com/repos/pysb/pysb/pulls/159/comments","review_comment_url":"https://api.github.com/repos/pysb/pysb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pysb/pysb/issues/159/comments","statuses_url":"https://api.github.com/repos/pysb/pysb/statuses/e7e96679bee4fa2d0156377d40c6fa4d2918b21f","head":{"label":"alubbock:test_util","ref":"test_util","sha":"e7e96679bee4fa2d0156377d40c6fa4d2918b21f","user":{"login":"alubbock","id":2590257,"avatar_url":"https://avatars.githubusercontent.com/u/2590257?v=3","gravatar_id":"","url":"https://api.github.com/users/alubbock","html_url":"https://github.com/alubbock","followers_url":"https://api.github.com/users/alubbock/followers","following_url":"https://api.github.com/users/alubbock/following{/other_user}","gists_url":"https://api.github.com/users/alubbock/gists{/gist_id}","starred_url":"https://api.github.com/users/alubbock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alubbock/subscriptions","organizations_url":"https://api.github.com/users/alubbock/orgs","repos_url":"https://api.github.com/users/alubbock/repos","events_url":"https://api.github.com/users/alubbock/events{/privacy}","received_events_url":"https://api.github.com/users/alubbock/received_events","type":"User","site_admin":false},"repo":{"id":13860026,"name":"pysb","full_name":"alubbock/pysb","owner":{"login":"alubbock","id":2590257,"avatar_url":"https://avatars.githubusercontent.com/u/2590257?v=3","gravatar_id":"","url":"https://api.github.com/users/alubbock","html_url":"https://github.com/alubbock","followers_url":"https://api.github.com/users/alubbock/followers","following_url":"https://api.github.com/users/alubbock/following{/other_user}","gists_url":"https://api.github.com/users/alubbock/gists{/gist_id}","starred_url":"https://api.github.com/users/alubbock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alubbock/subscriptions","organizations_url":"https://api.github.com/users/alubbock/orgs","repos_url":"https://api.github.com/users/alubbock/repos","events_url":"https://api.github.com/users/alubbock/events{/privacy}","received_events_url":"https://api.github.com/users/alubbock/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alubbock/pysb","description":"Python framework for Systems Biology modeling","fork":true,"url":"https://api.github.com/repos/alubbock/pysb","forks_url":"https://api.github.com/repos/alubbock/pysb/forks","keys_url":"https://api.github.com/repos/alubbock/pysb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alubbock/pysb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alubbock/pysb/teams","hooks_url":"https://api.github.com/repos/alubbock/pysb/hooks","issue_events_url":"https://api.github.com/repos/alubbock/pysb/issues/events{/number}","events_url":"https://api.github.com/repos/alubbock/pysb/events","assignees_url":"https://api.github.com/repos/alubbock/pysb/assignees{/user}","branches_url":"https://api.github.com/repos/alubbock/pysb/branches{/branch}","tags_url":"https://api.github.com/repos/alubbock/pysb/tags","blobs_url":"https://api.github.com/repos/alubbock/pysb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alubbock/pysb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alubbock/pysb/git/refs{/sha}","trees_url":"https://api.github.com/repos/alubbock/pysb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alubbock/pysb/statuses/{sha}","languages_url":"https://api.github.com/repos/alubbock/pysb/languages","stargazers_url":"https://api.github.com/repos/alubbock/pysb/stargazers","contributors_url":"https://api.github.com/repos/alubbock/pysb/contributors","subscribers_url":"https://api.github.com/repos/alubbock/pysb/subscribers","subscription_url":"https://api.github.com/repos/alubbock/pysb/subscription","commits_url":"https://api.github.com/repos/alubbock/pysb/commits{/sha}","git_commits_url":"https://api.github.com/repos/alubbock/pysb/git/commits{/sha}","comments_url":"https://api.github.com/repos/alubbock/pysb/comments{/number}","issue_comment_url":"https://api.github.com/repos/alubbock/pysb/issues/comments{/number}","contents_url":"https://api.github.com/repos/alubbock/pysb/contents/{+path}","compare_url":"https://api.github.com/repos/alubbock/pysb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alubbock/pysb/merges","archive_url":"https://api.github.com/repos/alubbock/pysb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alubbock/pysb/downloads","issues_url":"https://api.github.com/repos/alubbock/pysb/issues{/number}","pulls_url":"https://api.github.com/repos/alubbock/pysb/pulls{/number}","milestones_url":"https://api.github.com/repos/alubbock/pysb/milestones{/number}","notifications_url":"https://api.github.com/repos/alubbock/pysb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alubbock/pysb/labels{/name}","releases_url":"https://api.github.com/repos/alubbock/pysb/releases{/id}","created_at":"2013-10-25T12:33:07Z","updated_at":"2014-10-01T09:47:06Z","pushed_at":"2015-09-25T02:14:25Z","git_url":"git://github.com/alubbock/pysb.git","ssh_url":"git@github.com:alubbock/pysb.git","clone_url":"https://github.com/alubbock/pysb.git","svn_url":"https://github.com/alubbock/pysb","homepage":"","size":2977,"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":"pysb:master","ref":"master","sha":"5ecec2199b9f3dc8ff733f7a71bc7fa423f7350f","user":{"login":"pysb","id":1583829,"avatar_url":"https://avatars.githubusercontent.com/u/1583829?v=3","gravatar_id":"","url":"https://api.github.com/users/pysb","html_url":"https://github.com/pysb","followers_url":"https://api.github.com/users/pysb/followers","following_url":"https://api.github.com/users/pysb/following{/other_user}","gists_url":"https://api.github.com/users/pysb/gists{/gist_id}","starred_url":"https://api.github.com/users/pysb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pysb/subscriptions","organizations_url":"https://api.github.com/users/pysb/orgs","repos_url":"https://api.github.com/users/pysb/repos","events_url":"https://api.github.com/users/pysb/events{/privacy}","received_events_url":"https://api.github.com/users/pysb/received_events","type":"Organization","site_admin":false},"repo":{"id":972691,"name":"pysb","full_name":"pysb/pysb","owner":{"login":"pysb","id":1583829,"avatar_url":"https://avatars.githubusercontent.com/u/1583829?v=3","gravatar_id":"","url":"https://api.github.com/users/pysb","html_url":"https://github.com/pysb","followers_url":"https://api.github.com/users/pysb/followers","following_url":"https://api.github.com/users/pysb/following{/other_user}","gists_url":"https://api.github.com/users/pysb/gists{/gist_id}","starred_url":"https://api.github.com/users/pysb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pysb/subscriptions","organizations_url":"https://api.github.com/users/pysb/orgs","repos_url":"https://api.github.com/users/pysb/repos","events_url":"https://api.github.com/users/pysb/events{/privacy}","received_events_url":"https://api.github.com/users/pysb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pysb/pysb","description":"Python framework for Systems Biology modeling","fork":false,"url":"https://api.github.com/repos/pysb/pysb","forks_url":"https://api.github.com/repos/pysb/pysb/forks","keys_url":"https://api.github.com/repos/pysb/pysb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pysb/pysb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pysb/pysb/teams","hooks_url":"https://api.github.com/repos/pysb/pysb/hooks","issue_events_url":"https://api.github.com/repos/pysb/pysb/issues/events{/number}","events_url":"https://api.github.com/repos/pysb/pysb/events","assignees_url":"https://api.github.com/repos/pysb/pysb/assignees{/user}","branches_url":"https://api.github.com/repos/pysb/pysb/branches{/branch}","tags_url":"https://api.github.com/repos/pysb/pysb/tags","blobs_url":"https://api.github.com/repos/pysb/pysb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pysb/pysb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pysb/pysb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pysb/pysb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pysb/pysb/statuses/{sha}","languages_url":"https://api.github.com/repos/pysb/pysb/languages","stargazers_url":"https://api.github.com/repos/pysb/pysb/stargazers","contributors_url":"https://api.github.com/repos/pysb/pysb/contributors","subscribers_url":"https://api.github.com/repos/pysb/pysb/subscribers","subscription_url":"https://api.github.com/repos/pysb/pysb/subscription","commits_url":"https://api.github.com/repos/pysb/pysb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pysb/pysb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pysb/pysb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pysb/pysb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pysb/pysb/contents/{+path}","compare_url":"https://api.github.com/repos/pysb/pysb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pysb/pysb/merges","archive_url":"https://api.github.com/repos/pysb/pysb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pysb/pysb/downloads","issues_url":"https://api.github.com/repos/pysb/pysb/issues{/number}","pulls_url":"https://api.github.com/repos/pysb/pysb/pulls{/number}","milestones_url":"https://api.github.com/repos/pysb/pysb/milestones{/number}","notifications_url":"https://api.github.com/repos/pysb/pysb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pysb/pysb/labels{/name}","releases_url":"https://api.github.com/repos/pysb/pysb/releases{/id}","created_at":"2010-10-08T16:51:11Z","updated_at":"2015-07-03T08:33:15Z","pushed_at":"2015-09-25T13:38:16Z","git_url":"git://github.com/pysb/pysb.git","ssh_url":"git@github.com:pysb/pysb.git","clone_url":"https://github.com/pysb/pysb.git","svn_url":"https://github.com/pysb/pysb","homepage":"","size":7397,"stargazers_count":23,"watchers_count":23,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":76,"forks":25,"open_issues":76,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pysb/pysb/pulls/159"},"html":{"href":"https://github.com/pysb/pysb/pull/159"},"issue":{"href":"https://api.github.com/repos/pysb/pysb/issues/159"},"comments":{"href":"https://api.github.com/repos/pysb/pysb/issues/159/comments"},"review_comments":{"href":"https://api.github.com/repos/pysb/pysb/pulls/159/comments"},"review_comment":{"href":"https://api.github.com/repos/pysb/pysb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pysb/pysb/pulls/159/commits"},"statuses":{"href":"https://api.github.com/repos/pysb/pysb/statuses/e7e96679bee4fa2d0156377d40c6fa4d2918b21f"}}}}