{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/89720087","pull_request_review_id":10257112,"id":89720087,"diff_hunk":"@@ -881,13 +881,102 @@ def test_export_by_versions(self):\n def _get_change_list(state_name, property_name, new_value):\n     \"\"\"Generates a change list for a single state change.\"\"\"\n     return [{\n-        'cmd': 'edit_state_property',\n+        'cmd': exp_domain.CMD_EDIT_STATE_PROPERTY,\n         'state_name': state_name,\n         'property_name': property_name,\n         'new_value': new_value\n     }]\n \n \n+class UpdateGadgetTests(ExplorationServicesUnitTests):\n+    \"\"\"Test updating a gadget.\"\"\"\n+\n+    def setUp(self):\n+        super(UpdateGadgetTests, self).setUp()\n+        exploration = self.save_new_valid_exploration(\n+            self.EXP_ID, self.owner_id)\n+\n+        self.init_state_name = exploration.init_state_name\n+\n+        self.param_changes = [{\n+            'customization_args': {\n+                'list_of_values': ['1', '2'], 'parse_with_jinja': False\n+            },\n+            'name': 'myParam',\n+            'generator_id': 'RandomSelector'\n+        }]\n+        # List of answer groups to add into an interaction.\n+        self.interaction_answer_groups = [{\n+            'rule_specs': [{\n+                'rule_type': 'Equals',\n+                'inputs': {'x': 0},\n+            }],\n+            'outcome': {\n+                'dest': self.init_state_name,\n+                'feedback': ['Try again'],\n+                'param_changes': []\n+            },\n+        }]\n+        # Default outcome specification for an interaction.\n+        self.interaction_default_outcome = {\n+            'dest': self.init_state_name,\n+            'feedback': ['Incorrect', '<b>Wrong answer</b>'],\n+            'param_changes': []\n+        }\n+\n+\n+    def test_gadget_commands(self):","path":"core/domain/exp_services_test.py","position":81,"original_position":81,"commit_id":"d848a726ae41dfd436ebfb5d60807b31ac4543cb","original_commit_id":"d848a726ae41dfd436ebfb5d60807b31ac4543cb","user":{"login":"kefeh","id":15707199,"avatar_url":"https://avatars.githubusercontent.com/u/15707199?v=3","gravatar_id":"","url":"https://api.github.com/users/kefeh","html_url":"https://github.com/kefeh","followers_url":"https://api.github.com/users/kefeh/followers","following_url":"https://api.github.com/users/kefeh/following{/other_user}","gists_url":"https://api.github.com/users/kefeh/gists{/gist_id}","starred_url":"https://api.github.com/users/kefeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kefeh/subscriptions","organizations_url":"https://api.github.com/users/kefeh/orgs","repos_url":"https://api.github.com/users/kefeh/repos","events_url":"https://api.github.com/users/kefeh/events{/privacy}","received_events_url":"https://api.github.com/users/kefeh/received_events","type":"User","site_admin":false},"body":"Hello @seanlip i have done that but the exploration.add_gadget() function isnt adding the gadget, the test gives an error `ValueError: Gadget ATestGadget does not exist.`. This is a sample code ` def test_delete_gadget_cmd(self):\r\n        \"\"\"test delete\"\"\"\r\n        TEST_GADGET_CUSTOMIZATION_ARGS = {\r\n            'adviceObjects': {\r\n                'value': [{\r\n                    'adviceTitle': 'b',\r\n                    'adviceHtml': '<p>c</p>'\r\n                }]\r\n            }\r\n        }\r\n\r\n        TEST_GADGET_DICT = {\r\n            'gadget_type': 'TestGadget',\r\n            'gadget_name': 'ATestGadget',\r\n            'customization_args': TEST_GADGET_CUSTOMIZATION_ARGS,\r\n            'visible_in_states': ['First state']\r\n        }\r\n\r\n        exploration = exp_services.get_exploration_by_id(self.EXP_ID)\r\n        exploration.add_gadget(TEST_GADGET_DICT, 'bottom')\r\n\r\n        self.assertIn('ATestGadget', exploration.get_all_gadget_names())\r\n\r\n        exp_services.update_exploration(self.owner_id, self.EXP_ID, [{\r\n            'cmd': exp_domain.CMD_DELETE_GADGET,\r\n            'gadget_name': 'ATestGadget',\r\n            }], 'delete a gadget')\r\n\r\n        exploration = exp_services.get_exploration_by_id(self.EXP_ID)\r\n\r\n        self.assertNotIn('ATestGadget', exploration.get_all_gadget_names())`","created_at":"2016-11-28T05:37:21Z","updated_at":"2016-11-28T05:37:21Z","html_url":"https://github.com/oppia/oppia/pull/2721#discussion_r89720087","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/2721","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/89720087"},"html":{"href":"https://github.com/oppia/oppia/pull/2721#discussion_r89720087"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/2721"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/2721","id":93509077,"html_url":"https://github.com/oppia/oppia/pull/2721","diff_url":"https://github.com/oppia/oppia/pull/2721.diff","patch_url":"https://github.com/oppia/oppia/pull/2721.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/2721","number":2721,"state":"open","locked":false,"title":"Fix #2536: Adds tests for gadget cmds and ensures tests actually do something","user":{"login":"kefeh","id":15707199,"avatar_url":"https://avatars.githubusercontent.com/u/15707199?v=3","gravatar_id":"","url":"https://api.github.com/users/kefeh","html_url":"https://github.com/kefeh","followers_url":"https://api.github.com/users/kefeh/followers","following_url":"https://api.github.com/users/kefeh/following{/other_user}","gists_url":"https://api.github.com/users/kefeh/gists{/gist_id}","starred_url":"https://api.github.com/users/kefeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kefeh/subscriptions","organizations_url":"https://api.github.com/users/kefeh/orgs","repos_url":"https://api.github.com/users/kefeh/repos","events_url":"https://api.github.com/users/kefeh/events{/privacy}","received_events_url":"https://api.github.com/users/kefeh/received_events","type":"User","site_admin":false},"body":"Added tests for gadget commands.\r\nMake sure tests are actually doing something by asserting the present state and then confirming change through assertions.","created_at":"2016-11-14T05:12:37Z","updated_at":"2016-11-28T05:37:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b93e9de340ecfc20374332759cf784dcde249fe5","assignee":{"login":"BenHenning","id":12983742,"avatar_url":"https://avatars.githubusercontent.com/u/12983742?v=3","gravatar_id":"","url":"https://api.github.com/users/BenHenning","html_url":"https://github.com/BenHenning","followers_url":"https://api.github.com/users/BenHenning/followers","following_url":"https://api.github.com/users/BenHenning/following{/other_user}","gists_url":"https://api.github.com/users/BenHenning/gists{/gist_id}","starred_url":"https://api.github.com/users/BenHenning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenHenning/subscriptions","organizations_url":"https://api.github.com/users/BenHenning/orgs","repos_url":"https://api.github.com/users/BenHenning/repos","events_url":"https://api.github.com/users/BenHenning/events{/privacy}","received_events_url":"https://api.github.com/users/BenHenning/received_events","type":"User","site_admin":false},"assignees":[{"login":"BenHenning","id":12983742,"avatar_url":"https://avatars.githubusercontent.com/u/12983742?v=3","gravatar_id":"","url":"https://api.github.com/users/BenHenning","html_url":"https://github.com/BenHenning","followers_url":"https://api.github.com/users/BenHenning/followers","following_url":"https://api.github.com/users/BenHenning/following{/other_user}","gists_url":"https://api.github.com/users/BenHenning/gists{/gist_id}","starred_url":"https://api.github.com/users/BenHenning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenHenning/subscriptions","organizations_url":"https://api.github.com/users/BenHenning/orgs","repos_url":"https://api.github.com/users/BenHenning/repos","events_url":"https://api.github.com/users/BenHenning/events{/privacy}","received_events_url":"https://api.github.com/users/BenHenning/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/2721/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/2721/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/2721/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/d848a726ae41dfd436ebfb5d60807b31ac4543cb","head":{"label":"kefeh:develop","ref":"develop","sha":"d848a726ae41dfd436ebfb5d60807b31ac4543cb","user":{"login":"kefeh","id":15707199,"avatar_url":"https://avatars.githubusercontent.com/u/15707199?v=3","gravatar_id":"","url":"https://api.github.com/users/kefeh","html_url":"https://github.com/kefeh","followers_url":"https://api.github.com/users/kefeh/followers","following_url":"https://api.github.com/users/kefeh/following{/other_user}","gists_url":"https://api.github.com/users/kefeh/gists{/gist_id}","starred_url":"https://api.github.com/users/kefeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kefeh/subscriptions","organizations_url":"https://api.github.com/users/kefeh/orgs","repos_url":"https://api.github.com/users/kefeh/repos","events_url":"https://api.github.com/users/kefeh/events{/privacy}","received_events_url":"https://api.github.com/users/kefeh/received_events","type":"User","site_admin":false},"repo":{"id":71239812,"name":"oppia","full_name":"kefeh/oppia","owner":{"login":"kefeh","id":15707199,"avatar_url":"https://avatars.githubusercontent.com/u/15707199?v=3","gravatar_id":"","url":"https://api.github.com/users/kefeh","html_url":"https://github.com/kefeh","followers_url":"https://api.github.com/users/kefeh/followers","following_url":"https://api.github.com/users/kefeh/following{/other_user}","gists_url":"https://api.github.com/users/kefeh/gists{/gist_id}","starred_url":"https://api.github.com/users/kefeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kefeh/subscriptions","organizations_url":"https://api.github.com/users/kefeh/orgs","repos_url":"https://api.github.com/users/kefeh/repos","events_url":"https://api.github.com/users/kefeh/events{/privacy}","received_events_url":"https://api.github.com/users/kefeh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kefeh/oppia","description":"Tool for collaboratively building interactive lessons.","fork":true,"url":"https://api.github.com/repos/kefeh/oppia","forks_url":"https://api.github.com/repos/kefeh/oppia/forks","keys_url":"https://api.github.com/repos/kefeh/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kefeh/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kefeh/oppia/teams","hooks_url":"https://api.github.com/repos/kefeh/oppia/hooks","issue_events_url":"https://api.github.com/repos/kefeh/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/kefeh/oppia/events","assignees_url":"https://api.github.com/repos/kefeh/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/kefeh/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/kefeh/oppia/tags","blobs_url":"https://api.github.com/repos/kefeh/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kefeh/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kefeh/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/kefeh/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kefeh/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/kefeh/oppia/languages","stargazers_url":"https://api.github.com/repos/kefeh/oppia/stargazers","contributors_url":"https://api.github.com/repos/kefeh/oppia/contributors","subscribers_url":"https://api.github.com/repos/kefeh/oppia/subscribers","subscription_url":"https://api.github.com/repos/kefeh/oppia/subscription","commits_url":"https://api.github.com/repos/kefeh/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/kefeh/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/kefeh/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/kefeh/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/kefeh/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/kefeh/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kefeh/oppia/merges","archive_url":"https://api.github.com/repos/kefeh/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kefeh/oppia/downloads","issues_url":"https://api.github.com/repos/kefeh/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/kefeh/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/kefeh/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/kefeh/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kefeh/oppia/labels{/name}","releases_url":"https://api.github.com/repos/kefeh/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/kefeh/oppia/deployments","created_at":"2016-10-18T11:09:34Z","updated_at":"2016-10-18T11:09:37Z","pushed_at":"2016-11-19T02:49:17Z","git_url":"git://github.com/kefeh/oppia.git","ssh_url":"git@github.com:kefeh/oppia.git","clone_url":"https://github.com/kefeh/oppia.git","svn_url":"https://github.com/kefeh/oppia","homepage":"https://www.oppia.org","size":48051,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"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":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"a2ef90e7a9d5ef09b28507fe6607d3dffb74469a","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building interactive lessons.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/oppia/oppia/deployments","created_at":"2015-08-14T00:16:14Z","updated_at":"2016-11-27T18:13:55Z","pushed_at":"2016-11-28T04:38:16Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":91365,"stargazers_count":196,"watchers_count":196,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":293,"mirror_url":null,"open_issues_count":360,"forks":293,"open_issues":360,"watchers":196,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/2721"},"html":{"href":"https://github.com/oppia/oppia/pull/2721"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/2721"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/2721/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/2721/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/2721/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/d848a726ae41dfd436ebfb5d60807b31ac4543cb"}}}}
{"actor":{"display_login":"kefeh"}}