{"action":"created","comment":{"url":"https://api.github.com/repos/erdc/quest/pulls/comments/209684559","pull_request_review_id":145745257,"id":209684559,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTY4NDU1OQ==","diff_hunk":"@@ -133,13 +162,75 @@ def test_delete_active_project_without_default(api, reset_projects_dir, set_acti\n     assert new_active_project in c\n \n \n-def test_remove_project():\n-    pass\n-    # todo test remove project\n-    # test case where project is removed and then re-added\n+def test_delete_non_existing_project(api, reset_projects_dir):\n+    projects = api.get_projects()\n+\n+    p = api.delete_project('non_existing_project')\n+    assert projects == p\n+\n+\n+def test_new_delete_project_with_absolute_path(api, reset_projects_dir):\n+    project_name = 'test'\n+    path = os.path.join(reset_projects_dir['BASE_DIR'], 'test_project')\n+    api.new_project(\n+        name=project_name,\n+        folder=path,\n+    )\n+    p = api.get_projects()\n+    assert len(p) == reset_projects_dir['NUMBER_OF_PROJECTS'] + 1\n+    assert project_name in p\n+    c = api.delete_project(project_name)\n+    assert len(c) == reset_projects_dir['NUMBER_OF_PROJECTS']\n+    assert project_name not in c\n+\n+\n+def test_delete_project_removes_collections(api, reset_projects_dir, set_active_project):\n+    c = api.get_collections()\n+    assert len(c) > 0\n+    p = api.delete_project(ACTIVE_PROJECT)\n+    assert len(p) == reset_projects_dir['NUMBER_OF_PROJECTS'] - 1\n+    assert ACTIVE_PROJECT not in p\n+\n+    api.new_project(ACTIVE_PROJECT)\n+    p = api.get_projects()\n+    assert ACTIVE_PROJECT in p\n+    c = api.get_collections()\n+    assert len(c) == 0\n+\n+\n+def test_remove_project(api, reset_projects_dir, test_project):\n+    projects = api.get_projects(expand=True)\n+    folder = projects[test_project]['folder']\n+\n+    api.remove_project(test_project)\n+    assert os.path.exists(folder)\n+\n+    with pytest.raises(ValueError):\n+        api.new_project(test_project, folder)\n+\n+    api.add_project(test_project, folder)\n+\n+\n+def test_remove_non_existing_project(api, reset_projects_dir):\n+    projects = api.get_projects()\n+\n+    p = api.remove_project('non_existing_project')\n+    assert projects == p\n \n \n def test_set_active_project(api, set_active_project):\n     assert api.get_active_project() == 'project1'\n     api.set_active_project('default')\n     assert api.get_active_project() == 'default'\n+\n+\n+def test_set_active_project_non_existing(api):\n+    with pytest.raises(ValueError):\n+        api.set_active_project('non_existing_project')\n+\n+\n+def test__load_project_non_existing(api):\n+    with pytest.raises(ValueError):\n+        api.projects._load_project('non_existing_project')\n+\n+","path":"test/test_projects.py","position":129,"original_position":129,"commit_id":"bcafcd6b7a7bf0227e7548dc31bc860a332242c3","original_commit_id":"bcafcd6b7a7bf0227e7548dc31bc860a332242c3","user":{"login":"stickler-ci","id":16011037,"node_id":"MDQ6VXNlcjE2MDExMDM3","avatar_url":"https://avatars3.githubusercontent.com/u/16011037?v=4","gravatar_id":"","url":"https://api.github.com/users/stickler-ci","html_url":"https://github.com/stickler-ci","followers_url":"https://api.github.com/users/stickler-ci/followers","following_url":"https://api.github.com/users/stickler-ci/following{/other_user}","gists_url":"https://api.github.com/users/stickler-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/stickler-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickler-ci/subscriptions","organizations_url":"https://api.github.com/users/stickler-ci/orgs","repos_url":"https://api.github.com/users/stickler-ci/repos","events_url":"https://api.github.com/users/stickler-ci/events{/privacy}","received_events_url":"https://api.github.com/users/stickler-ci/received_events","type":"User","site_admin":false},"body":"W391 blank line at end of file","created_at":"2018-08-13T16:59:17Z","updated_at":"2018-08-13T16:59:17Z","html_url":"https://github.com/erdc/quest/pull/98#discussion_r209684559","pull_request_url":"https://api.github.com/repos/erdc/quest/pulls/98","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/erdc/quest/pulls/comments/209684559"},"html":{"href":"https://github.com/erdc/quest/pull/98#discussion_r209684559"},"pull_request":{"href":"https://api.github.com/repos/erdc/quest/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/erdc/quest/pulls/98","id":207755286,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NzU1Mjg2","html_url":"https://github.com/erdc/quest/pull/98","diff_url":"https://github.com/erdc/quest/pull/98.diff","patch_url":"https://github.com/erdc/quest/pull/98.patch","issue_url":"https://api.github.com/repos/erdc/quest/issues/98","number":98,"state":"open","locked":false,"title":"Fix how projects and db connections are initialized","user":{"login":"sdc50","id":6454472,"node_id":"MDQ6VXNlcjY0NTQ0NzI=","avatar_url":"https://avatars0.githubusercontent.com/u/6454472?v=4","gravatar_id":"","url":"https://api.github.com/users/sdc50","html_url":"https://github.com/sdc50","followers_url":"https://api.github.com/users/sdc50/followers","following_url":"https://api.github.com/users/sdc50/following{/other_user}","gists_url":"https://api.github.com/users/sdc50/gists{/gist_id}","starred_url":"https://api.github.com/users/sdc50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdc50/subscriptions","organizations_url":"https://api.github.com/users/sdc50/orgs","repos_url":"https://api.github.com/users/sdc50/repos","events_url":"https://api.github.com/users/sdc50/events{/privacy}","received_events_url":"https://api.github.com/users/sdc50/received_events","type":"User","site_admin":false},"body":"just-in-time project and db connection initialization","created_at":"2018-08-11T03:27:21Z","updated_at":"2018-08-13T16:59:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d27f91394697046d560f2b70cbf976e830abac8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/erdc/quest/pulls/98/commits","review_comments_url":"https://api.github.com/repos/erdc/quest/pulls/98/comments","review_comment_url":"https://api.github.com/repos/erdc/quest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/erdc/quest/issues/98/comments","statuses_url":"https://api.github.com/repos/erdc/quest/statuses/bcafcd6b7a7bf0227e7548dc31bc860a332242c3","head":{"label":"sdc50:redo_init","ref":"redo_init","sha":"bcafcd6b7a7bf0227e7548dc31bc860a332242c3","user":{"login":"sdc50","id":6454472,"node_id":"MDQ6VXNlcjY0NTQ0NzI=","avatar_url":"https://avatars0.githubusercontent.com/u/6454472?v=4","gravatar_id":"","url":"https://api.github.com/users/sdc50","html_url":"https://github.com/sdc50","followers_url":"https://api.github.com/users/sdc50/followers","following_url":"https://api.github.com/users/sdc50/following{/other_user}","gists_url":"https://api.github.com/users/sdc50/gists{/gist_id}","starred_url":"https://api.github.com/users/sdc50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdc50/subscriptions","organizations_url":"https://api.github.com/users/sdc50/orgs","repos_url":"https://api.github.com/users/sdc50/repos","events_url":"https://api.github.com/users/sdc50/events{/privacy}","received_events_url":"https://api.github.com/users/sdc50/received_events","type":"User","site_admin":false},"repo":{"id":120814382,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA4MTQzODI=","name":"quest","full_name":"sdc50/quest","owner":{"login":"sdc50","id":6454472,"node_id":"MDQ6VXNlcjY0NTQ0NzI=","avatar_url":"https://avatars0.githubusercontent.com/u/6454472?v=4","gravatar_id":"","url":"https://api.github.com/users/sdc50","html_url":"https://github.com/sdc50","followers_url":"https://api.github.com/users/sdc50/followers","following_url":"https://api.github.com/users/sdc50/following{/other_user}","gists_url":"https://api.github.com/users/sdc50/gists{/gist_id}","starred_url":"https://api.github.com/users/sdc50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdc50/subscriptions","organizations_url":"https://api.github.com/users/sdc50/orgs","repos_url":"https://api.github.com/users/sdc50/repos","events_url":"https://api.github.com/users/sdc50/events{/privacy}","received_events_url":"https://api.github.com/users/sdc50/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdc50/quest","description":null,"fork":true,"url":"https://api.github.com/repos/sdc50/quest","forks_url":"https://api.github.com/repos/sdc50/quest/forks","keys_url":"https://api.github.com/repos/sdc50/quest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdc50/quest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdc50/quest/teams","hooks_url":"https://api.github.com/repos/sdc50/quest/hooks","issue_events_url":"https://api.github.com/repos/sdc50/quest/issues/events{/number}","events_url":"https://api.github.com/repos/sdc50/quest/events","assignees_url":"https://api.github.com/repos/sdc50/quest/assignees{/user}","branches_url":"https://api.github.com/repos/sdc50/quest/branches{/branch}","tags_url":"https://api.github.com/repos/sdc50/quest/tags","blobs_url":"https://api.github.com/repos/sdc50/quest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdc50/quest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdc50/quest/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdc50/quest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdc50/quest/statuses/{sha}","languages_url":"https://api.github.com/repos/sdc50/quest/languages","stargazers_url":"https://api.github.com/repos/sdc50/quest/stargazers","contributors_url":"https://api.github.com/repos/sdc50/quest/contributors","subscribers_url":"https://api.github.com/repos/sdc50/quest/subscribers","subscription_url":"https://api.github.com/repos/sdc50/quest/subscription","commits_url":"https://api.github.com/repos/sdc50/quest/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdc50/quest/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdc50/quest/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdc50/quest/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdc50/quest/contents/{+path}","compare_url":"https://api.github.com/repos/sdc50/quest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdc50/quest/merges","archive_url":"https://api.github.com/repos/sdc50/quest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdc50/quest/downloads","issues_url":"https://api.github.com/repos/sdc50/quest/issues{/number}","pulls_url":"https://api.github.com/repos/sdc50/quest/pulls{/number}","milestones_url":"https://api.github.com/repos/sdc50/quest/milestones{/number}","notifications_url":"https://api.github.com/repos/sdc50/quest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdc50/quest/labels{/name}","releases_url":"https://api.github.com/repos/sdc50/quest/releases{/id}","deployments_url":"https://api.github.com/repos/sdc50/quest/deployments","created_at":"2018-02-08T20:31:42Z","updated_at":"2018-08-11T03:20:31Z","pushed_at":"2018-08-13T16:59:07Z","git_url":"git://github.com/sdc50/quest.git","ssh_url":"git@github.com:sdc50/quest.git","clone_url":"https://github.com/sdc50/quest.git","svn_url":"https://github.com/sdc50/quest","homepage":null,"size":10110,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"erdc:master","ref":"master","sha":"1050ecfb5440857aa6416e66415ea7dde4f0e659","user":{"login":"erdc","id":616627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNjYyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/616627?v=4","gravatar_id":"","url":"https://api.github.com/users/erdc","html_url":"https://github.com/erdc","followers_url":"https://api.github.com/users/erdc/followers","following_url":"https://api.github.com/users/erdc/following{/other_user}","gists_url":"https://api.github.com/users/erdc/gists{/gist_id}","starred_url":"https://api.github.com/users/erdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erdc/subscriptions","organizations_url":"https://api.github.com/users/erdc/orgs","repos_url":"https://api.github.com/users/erdc/repos","events_url":"https://api.github.com/users/erdc/events{/privacy}","received_events_url":"https://api.github.com/users/erdc/received_events","type":"Organization","site_admin":false},"repo":{"id":120786584,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA3ODY1ODQ=","name":"quest","full_name":"erdc/quest","owner":{"login":"erdc","id":616627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNjYyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/616627?v=4","gravatar_id":"","url":"https://api.github.com/users/erdc","html_url":"https://github.com/erdc","followers_url":"https://api.github.com/users/erdc/followers","following_url":"https://api.github.com/users/erdc/following{/other_user}","gists_url":"https://api.github.com/users/erdc/gists{/gist_id}","starred_url":"https://api.github.com/users/erdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erdc/subscriptions","organizations_url":"https://api.github.com/users/erdc/orgs","repos_url":"https://api.github.com/users/erdc/repos","events_url":"https://api.github.com/users/erdc/events{/privacy}","received_events_url":"https://api.github.com/users/erdc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/erdc/quest","description":"Python API for downloading and managing data. Checkout the documentation at:","fork":false,"url":"https://api.github.com/repos/erdc/quest","forks_url":"https://api.github.com/repos/erdc/quest/forks","keys_url":"https://api.github.com/repos/erdc/quest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erdc/quest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erdc/quest/teams","hooks_url":"https://api.github.com/repos/erdc/quest/hooks","issue_events_url":"https://api.github.com/repos/erdc/quest/issues/events{/number}","events_url":"https://api.github.com/repos/erdc/quest/events","assignees_url":"https://api.github.com/repos/erdc/quest/assignees{/user}","branches_url":"https://api.github.com/repos/erdc/quest/branches{/branch}","tags_url":"https://api.github.com/repos/erdc/quest/tags","blobs_url":"https://api.github.com/repos/erdc/quest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erdc/quest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erdc/quest/git/refs{/sha}","trees_url":"https://api.github.com/repos/erdc/quest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erdc/quest/statuses/{sha}","languages_url":"https://api.github.com/repos/erdc/quest/languages","stargazers_url":"https://api.github.com/repos/erdc/quest/stargazers","contributors_url":"https://api.github.com/repos/erdc/quest/contributors","subscribers_url":"https://api.github.com/repos/erdc/quest/subscribers","subscription_url":"https://api.github.com/repos/erdc/quest/subscription","commits_url":"https://api.github.com/repos/erdc/quest/commits{/sha}","git_commits_url":"https://api.github.com/repos/erdc/quest/git/commits{/sha}","comments_url":"https://api.github.com/repos/erdc/quest/comments{/number}","issue_comment_url":"https://api.github.com/repos/erdc/quest/issues/comments{/number}","contents_url":"https://api.github.com/repos/erdc/quest/contents/{+path}","compare_url":"https://api.github.com/repos/erdc/quest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erdc/quest/merges","archive_url":"https://api.github.com/repos/erdc/quest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erdc/quest/downloads","issues_url":"https://api.github.com/repos/erdc/quest/issues{/number}","pulls_url":"https://api.github.com/repos/erdc/quest/pulls{/number}","milestones_url":"https://api.github.com/repos/erdc/quest/milestones{/number}","notifications_url":"https://api.github.com/repos/erdc/quest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erdc/quest/labels{/name}","releases_url":"https://api.github.com/repos/erdc/quest/releases{/id}","deployments_url":"https://api.github.com/repos/erdc/quest/deployments","created_at":"2018-02-08T16:27:45Z","updated_at":"2018-08-10T13:43:07Z","pushed_at":"2018-08-13T16:59:09Z","git_url":"git://github.com/erdc/quest.git","ssh_url":"git@github.com:erdc/quest.git","clone_url":"https://github.com/erdc/quest.git","svn_url":"https://github.com/erdc/quest","homepage":"https://quest.readthedocs.io/en/latest/","size":10043,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":22,"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":3,"open_issues":22,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/erdc/quest/pulls/98"},"html":{"href":"https://github.com/erdc/quest/pull/98"},"issue":{"href":"https://api.github.com/repos/erdc/quest/issues/98"},"comments":{"href":"https://api.github.com/repos/erdc/quest/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/erdc/quest/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/erdc/quest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/erdc/quest/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/erdc/quest/statuses/bcafcd6b7a7bf0227e7548dc31bc860a332242c3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"stickler-ci"}}