{"action":"created","comment":{"url":"https://api.github.com/repos/Exopy/exopy/pulls/comments/202103238","pull_request_review_id":136735314,"id":202103238,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjEwMzIzOA==","diff_hunk":"@@ -0,0 +1,135 @@\n+# -*- coding: utf-8 -*-\n+# -----------------------------------------------------------------------------\n+# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.\n+#\n+# Distributed under the terms of the BSD license.\n+#\n+# The full license is in the file LICENCE, distributed with this software.\n+# -----------------------------------------------------------------------------\n+\"\"\"Test the AddTask post hook.\n+\n+\"\"\"\n+import pytest\n+from atom.api import Tuple\n+from exopy.tasks.api import RootTask, SimpleTask\n+from enaml.workbench.api import Workbench\n+from exopy.testing.measurement.dummies import DummyEngine\n+from exopy.tasks.tasks.base_views import RootTaskView\n+\n+from exopy.testing.util import show_widget\n+pytest_plugins = str('exopy.testing.tasks.fixtures')\n+\n+\n+@pytest.fixture\n+def addtaskhook(measurement):\n+    \"\"\"Create an AddTaskHook.\n+\n+    \"\"\"\n+    hook = measurement.plugin.create('post-hook', 'exopy.addtask_hook')\n+    return hook\n+\n+\n+@pytest.fixture\n+def addtaskview(measurement_workbench, addtaskhook):\n+    \"\"\"Create an AddTaskView.\n+\n+    \"\"\"\n+    # on est obligé d'aller chercher dans le vrai manifest de measurement pour\n+    # trouver le make_view\n+    meas = measurement_workbench.get_plugin('exopy.measurement')\n+    decl = meas.get_declarations('exopy.addtask_hook') # check how to get the declaration\n+    view = decl.make_view(measurement_workbench, addtaskhook)\n+    return view\n+\n+\n+def test_new_addtask_hook(addtaskhook):\n+    \"\"\"Testing the creation of an AddTask post-hook\n+\n+    \"\"\"\n+    assert type(addtaskhook.root_task) == RootTask\n+    assert type(addtaskhook.workbench) == Workbench\n+    assert type(addtaskhook.dependencies) == Tuple\n+    assert addtaskhook.default_path\n+    assert addtaskhook.engine\n+\n+\n+def test_get_set_state(addtaskhook):\n+    \"\"\"Testing saving and loading the hook\n+\n+    \"\"\"\n+    root = addtaskhook.root_task\n+    # adding a task to the hook\n+    root.children = [SimpleTask(name='task',\n+                                database_entries={'val': 1},\n+                                root=root, parent=root,\n+                                database=root.database)]\n+    task_prefs = addtaskhook.get_state()\n+    print(task_prefs)\n+    assert task_prefs  # blabla selon sa structure ?\n+\n+    root.children = []\n+    assert len(root.children) == 0\n+    addtaskhook.set_state(task_prefs)\n+    assert len(root.children) == 1\n+    assert isinstance(root.children[0], SimpleTask)\n+\n+\n+def test_pause(addtaskhook):\n+    \"\"\"Testing the engine pause\n+\n+    \"\"\"\n+    addtaskhook.engine = DummyEngine()\n+    addtaskhook.pause()\n+    assert addtaskhook.engine.should_pause == True\n+\n+\n+def test_resume(addtaskhook):\n+    \"\"\"Testing the engine resume\n+\n+    \"\"\"\n+    addtaskhook.engine = DummyEngine()\n+    addtaskhook.resume()\n+    assert addtaskhook.engine.should_resume == True\n+\n+\n+def test_stop(addtaskhook):\n+    \"\"\"Testing the engine stop\n+\n+    \"\"\"\n+    addtaskhook.engine = DummyEngine()\n+    addtaskhook.stop(force=False)\n+    assert addtaskhook.engine._stop == True\n+\n+\n+def test_force_stop(addtaskhook):\n+    \"\"\"Testing the engine force stop\n+\n+    \"\"\"\n+    addtaskhook.engine = DummyEngine()\n+    addtaskhook.stop(force=True)\n+    assert addtaskhook.engine._stop == True\n+\n+def test_view(addtaskview, addtaskhook, exopy_qtbot, dialog_sleep):\n+    \"\"\"Testing the view\n+\n+    \"\"\"\n+    assert addtaskview.hook\n+    assert addtaskview.declaration.id == 'exopy.addtask_hook'\n+    assert addtaskview.workbench\n+    assert type(addtaskview.widget()[0]) == RootTaskView\n+    rootview = addtaskview.widget()[0]\n+    assert rootview.show_path == False\n+    # ca devrait marcher pcq on appelle une seule fois la fixture, ensuite c'est le même objet","path":"tests/measurement/hooks/test_addtask_hook.py","position":122,"original_position":122,"commit_id":"2286a8098465a1ac3c39de6cab928dd54d1d1f14","original_commit_id":"2286a8098465a1ac3c39de6cab928dd54d1d1f14","user":{"login":"MatthieuDartiailh","id":4481740,"node_id":"MDQ6VXNlcjQ0ODE3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/4481740?v=4","gravatar_id":"","url":"https://api.github.com/users/MatthieuDartiailh","html_url":"https://github.com/MatthieuDartiailh","followers_url":"https://api.github.com/users/MatthieuDartiailh/followers","following_url":"https://api.github.com/users/MatthieuDartiailh/following{/other_user}","gists_url":"https://api.github.com/users/MatthieuDartiailh/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthieuDartiailh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthieuDartiailh/subscriptions","organizations_url":"https://api.github.com/users/MatthieuDartiailh/orgs","repos_url":"https://api.github.com/users/MatthieuDartiailh/repos","events_url":"https://api.github.com/users/MatthieuDartiailh/events{/privacy}","received_events_url":"https://api.github.com/users/MatthieuDartiailh/received_events","type":"User","site_admin":false},"body":"In english please.","created_at":"2018-07-12T16:42:52Z","updated_at":"2018-07-12T16:45:20Z","html_url":"https://github.com/Exopy/exopy/pull/151#discussion_r202103238","pull_request_url":"https://api.github.com/repos/Exopy/exopy/pulls/151","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Exopy/exopy/pulls/comments/202103238"},"html":{"href":"https://github.com/Exopy/exopy/pull/151#discussion_r202103238"},"pull_request":{"href":"https://api.github.com/repos/Exopy/exopy/pulls/151"}}},"pull_request":{"url":"https://api.github.com/repos/Exopy/exopy/pulls/151","id":192327627,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMzI3NjI3","html_url":"https://github.com/Exopy/exopy/pull/151","diff_url":"https://github.com/Exopy/exopy/pull/151.diff","patch_url":"https://github.com/Exopy/exopy/pull/151.patch","issue_url":"https://api.github.com/repos/Exopy/exopy/issues/151","number":151,"state":"open","locked":false,"title":"Adding a post hook that can run a measurement - try 2","user":{"login":"lcontami","id":11089557,"node_id":"MDQ6VXNlcjExMDg5NTU3","avatar_url":"https://avatars0.githubusercontent.com/u/11089557?v=4","gravatar_id":"","url":"https://api.github.com/users/lcontami","html_url":"https://github.com/lcontami","followers_url":"https://api.github.com/users/lcontami/followers","following_url":"https://api.github.com/users/lcontami/following{/other_user}","gists_url":"https://api.github.com/users/lcontami/gists{/gist_id}","starred_url":"https://api.github.com/users/lcontami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcontami/subscriptions","organizations_url":"https://api.github.com/users/lcontami/orgs","repos_url":"https://api.github.com/users/lcontami/repos","events_url":"https://api.github.com/users/lcontami/events{/privacy}","received_events_url":"https://api.github.com/users/lcontami/received_events","type":"User","site_admin":false},"body":"As requested in issue #17","created_at":"2018-06-04T08:07:36Z","updated_at":"2018-07-12T16:45:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38e1aaa960dcf58f5c2d06a279497b00cd21a686","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Exopy/exopy/pulls/151/commits","review_comments_url":"https://api.github.com/repos/Exopy/exopy/pulls/151/comments","review_comment_url":"https://api.github.com/repos/Exopy/exopy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Exopy/exopy/issues/151/comments","statuses_url":"https://api.github.com/repos/Exopy/exopy/statuses/2286a8098465a1ac3c39de6cab928dd54d1d1f14","head":{"label":"Exopy:post_hook_2","ref":"post_hook_2","sha":"2286a8098465a1ac3c39de6cab928dd54d1d1f14","user":{"login":"Exopy","id":11776114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzc2MTE0","avatar_url":"https://avatars1.githubusercontent.com/u/11776114?v=4","gravatar_id":"","url":"https://api.github.com/users/Exopy","html_url":"https://github.com/Exopy","followers_url":"https://api.github.com/users/Exopy/followers","following_url":"https://api.github.com/users/Exopy/following{/other_user}","gists_url":"https://api.github.com/users/Exopy/gists{/gist_id}","starred_url":"https://api.github.com/users/Exopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Exopy/subscriptions","organizations_url":"https://api.github.com/users/Exopy/orgs","repos_url":"https://api.github.com/users/Exopy/repos","events_url":"https://api.github.com/users/Exopy/events{/privacy}","received_events_url":"https://api.github.com/users/Exopy/received_events","type":"Organization","site_admin":false},"repo":{"id":33326768,"node_id":"MDEwOlJlcG9zaXRvcnkzMzMyNjc2OA==","name":"exopy","full_name":"Exopy/exopy","owner":{"login":"Exopy","id":11776114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzc2MTE0","avatar_url":"https://avatars1.githubusercontent.com/u/11776114?v=4","gravatar_id":"","url":"https://api.github.com/users/Exopy","html_url":"https://github.com/Exopy","followers_url":"https://api.github.com/users/Exopy/followers","following_url":"https://api.github.com/users/Exopy/following{/other_user}","gists_url":"https://api.github.com/users/Exopy/gists{/gist_id}","starred_url":"https://api.github.com/users/Exopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Exopy/subscriptions","organizations_url":"https://api.github.com/users/Exopy/orgs","repos_url":"https://api.github.com/users/Exopy/repos","events_url":"https://api.github.com/users/Exopy/events{/privacy}","received_events_url":"https://api.github.com/users/Exopy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Exopy/exopy","description":"Exopy central application repository","fork":false,"url":"https://api.github.com/repos/Exopy/exopy","forks_url":"https://api.github.com/repos/Exopy/exopy/forks","keys_url":"https://api.github.com/repos/Exopy/exopy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Exopy/exopy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Exopy/exopy/teams","hooks_url":"https://api.github.com/repos/Exopy/exopy/hooks","issue_events_url":"https://api.github.com/repos/Exopy/exopy/issues/events{/number}","events_url":"https://api.github.com/repos/Exopy/exopy/events","assignees_url":"https://api.github.com/repos/Exopy/exopy/assignees{/user}","branches_url":"https://api.github.com/repos/Exopy/exopy/branches{/branch}","tags_url":"https://api.github.com/repos/Exopy/exopy/tags","blobs_url":"https://api.github.com/repos/Exopy/exopy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Exopy/exopy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Exopy/exopy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Exopy/exopy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Exopy/exopy/statuses/{sha}","languages_url":"https://api.github.com/repos/Exopy/exopy/languages","stargazers_url":"https://api.github.com/repos/Exopy/exopy/stargazers","contributors_url":"https://api.github.com/repos/Exopy/exopy/contributors","subscribers_url":"https://api.github.com/repos/Exopy/exopy/subscribers","subscription_url":"https://api.github.com/repos/Exopy/exopy/subscription","commits_url":"https://api.github.com/repos/Exopy/exopy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Exopy/exopy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Exopy/exopy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Exopy/exopy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Exopy/exopy/contents/{+path}","compare_url":"https://api.github.com/repos/Exopy/exopy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Exopy/exopy/merges","archive_url":"https://api.github.com/repos/Exopy/exopy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Exopy/exopy/downloads","issues_url":"https://api.github.com/repos/Exopy/exopy/issues{/number}","pulls_url":"https://api.github.com/repos/Exopy/exopy/pulls{/number}","milestones_url":"https://api.github.com/repos/Exopy/exopy/milestones{/number}","notifications_url":"https://api.github.com/repos/Exopy/exopy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Exopy/exopy/labels{/name}","releases_url":"https://api.github.com/repos/Exopy/exopy/releases{/id}","deployments_url":"https://api.github.com/repos/Exopy/exopy/deployments","created_at":"2015-04-02T19:07:19Z","updated_at":"2018-07-01T19:56:15Z","pushed_at":"2018-07-11T14:14:04Z","git_url":"git://github.com/Exopy/exopy.git","ssh_url":"git@github.com:Exopy/exopy.git","clone_url":"https://github.com/Exopy/exopy.git","svn_url":"https://github.com/Exopy/exopy","homepage":"http://exopy.readthedocs.io/","size":2195,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":39,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":9,"open_issues":39,"watchers":12,"default_branch":"master"}},"base":{"label":"Exopy:master","ref":"master","sha":"d3e5d5de0cb3592b830913d97095433f74e47ba6","user":{"login":"Exopy","id":11776114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzc2MTE0","avatar_url":"https://avatars1.githubusercontent.com/u/11776114?v=4","gravatar_id":"","url":"https://api.github.com/users/Exopy","html_url":"https://github.com/Exopy","followers_url":"https://api.github.com/users/Exopy/followers","following_url":"https://api.github.com/users/Exopy/following{/other_user}","gists_url":"https://api.github.com/users/Exopy/gists{/gist_id}","starred_url":"https://api.github.com/users/Exopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Exopy/subscriptions","organizations_url":"https://api.github.com/users/Exopy/orgs","repos_url":"https://api.github.com/users/Exopy/repos","events_url":"https://api.github.com/users/Exopy/events{/privacy}","received_events_url":"https://api.github.com/users/Exopy/received_events","type":"Organization","site_admin":false},"repo":{"id":33326768,"node_id":"MDEwOlJlcG9zaXRvcnkzMzMyNjc2OA==","name":"exopy","full_name":"Exopy/exopy","owner":{"login":"Exopy","id":11776114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzc2MTE0","avatar_url":"https://avatars1.githubusercontent.com/u/11776114?v=4","gravatar_id":"","url":"https://api.github.com/users/Exopy","html_url":"https://github.com/Exopy","followers_url":"https://api.github.com/users/Exopy/followers","following_url":"https://api.github.com/users/Exopy/following{/other_user}","gists_url":"https://api.github.com/users/Exopy/gists{/gist_id}","starred_url":"https://api.github.com/users/Exopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Exopy/subscriptions","organizations_url":"https://api.github.com/users/Exopy/orgs","repos_url":"https://api.github.com/users/Exopy/repos","events_url":"https://api.github.com/users/Exopy/events{/privacy}","received_events_url":"https://api.github.com/users/Exopy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Exopy/exopy","description":"Exopy central application repository","fork":false,"url":"https://api.github.com/repos/Exopy/exopy","forks_url":"https://api.github.com/repos/Exopy/exopy/forks","keys_url":"https://api.github.com/repos/Exopy/exopy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Exopy/exopy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Exopy/exopy/teams","hooks_url":"https://api.github.com/repos/Exopy/exopy/hooks","issue_events_url":"https://api.github.com/repos/Exopy/exopy/issues/events{/number}","events_url":"https://api.github.com/repos/Exopy/exopy/events","assignees_url":"https://api.github.com/repos/Exopy/exopy/assignees{/user}","branches_url":"https://api.github.com/repos/Exopy/exopy/branches{/branch}","tags_url":"https://api.github.com/repos/Exopy/exopy/tags","blobs_url":"https://api.github.com/repos/Exopy/exopy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Exopy/exopy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Exopy/exopy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Exopy/exopy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Exopy/exopy/statuses/{sha}","languages_url":"https://api.github.com/repos/Exopy/exopy/languages","stargazers_url":"https://api.github.com/repos/Exopy/exopy/stargazers","contributors_url":"https://api.github.com/repos/Exopy/exopy/contributors","subscribers_url":"https://api.github.com/repos/Exopy/exopy/subscribers","subscription_url":"https://api.github.com/repos/Exopy/exopy/subscription","commits_url":"https://api.github.com/repos/Exopy/exopy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Exopy/exopy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Exopy/exopy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Exopy/exopy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Exopy/exopy/contents/{+path}","compare_url":"https://api.github.com/repos/Exopy/exopy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Exopy/exopy/merges","archive_url":"https://api.github.com/repos/Exopy/exopy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Exopy/exopy/downloads","issues_url":"https://api.github.com/repos/Exopy/exopy/issues{/number}","pulls_url":"https://api.github.com/repos/Exopy/exopy/pulls{/number}","milestones_url":"https://api.github.com/repos/Exopy/exopy/milestones{/number}","notifications_url":"https://api.github.com/repos/Exopy/exopy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Exopy/exopy/labels{/name}","releases_url":"https://api.github.com/repos/Exopy/exopy/releases{/id}","deployments_url":"https://api.github.com/repos/Exopy/exopy/deployments","created_at":"2015-04-02T19:07:19Z","updated_at":"2018-07-01T19:56:15Z","pushed_at":"2018-07-11T14:14:04Z","git_url":"git://github.com/Exopy/exopy.git","ssh_url":"git@github.com:Exopy/exopy.git","clone_url":"https://github.com/Exopy/exopy.git","svn_url":"https://github.com/Exopy/exopy","homepage":"http://exopy.readthedocs.io/","size":2195,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":39,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":9,"open_issues":39,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Exopy/exopy/pulls/151"},"html":{"href":"https://github.com/Exopy/exopy/pull/151"},"issue":{"href":"https://api.github.com/repos/Exopy/exopy/issues/151"},"comments":{"href":"https://api.github.com/repos/Exopy/exopy/issues/151/comments"},"review_comments":{"href":"https://api.github.com/repos/Exopy/exopy/pulls/151/comments"},"review_comment":{"href":"https://api.github.com/repos/Exopy/exopy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Exopy/exopy/pulls/151/commits"},"statuses":{"href":"https://api.github.com/repos/Exopy/exopy/statuses/2286a8098465a1ac3c39de6cab928dd54d1d1f14"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"MatthieuDartiailh"}}