{"action":"created","comment":{"url":"https://api.github.com/repos/juju/charmstore/pulls/comments/44545761","id":44545761,"diff_hunk":"@@ -38,12 +41,85 @@ import (\n \t\"gopkg.in/juju/charmstore.v5-unstable/internal/v4\"\n )\n \n-type ArchiveSuite struct {\n+type commonArchiveSuite struct {\n \tcommonSuite\n }\n \n+type ArchiveSuiteUnconfiguredTerms struct {\n+\tcommonArchiveSuite\n+}\n+\n+var _ = gc.Suite(&ArchiveSuiteUnconfiguredTerms{})\n+\n+func (s *ArchiveSuiteUnconfiguredTerms) TestGetCharmWithTerms(c *gc.C) {\n+\ts.dischargeTerms = func(s1, s2 string) ([]checkers.Caveat, error) {\n+\t\treturn nil, nil\n+\t}\n+\tclient := httpbakery.NewHTTPClient()\n+\n+\tpatchArchiveCacheAges(s)\n+\tid := newResolvedURL(\"cs:~charmers/precise/terms-0\", -1)\n+\ts.assertUploadCharm(c, \"POST\", id, \"terms\")\n+\terr := s.store.SetPerms(&id.URL, \"read\", params.Everyone, id.URL.User)\n+\tc.Assert(err, gc.IsNil)\n+\n+\tarchiveUrl := storeURL(\"~charmers/precise/terms-0/archive\")\n+\trec := httptesting.DoRequest(c, httptesting.DoRequestParams{\n+\t\tHandler: s.srv,\n+\t\tURL:     archiveUrl,\n+\t\tDo:      bakeryDo(client),\n+\t})\n+\tc.Assert(rec.Code, gc.Equals, http.StatusInternalServerError)","path":"internal/v4/archive_test.go","position":49,"original_position":49,"commit_id":"b9b461cad307aca9ea7024aea03be2377fc7d6da","original_commit_id":"b9b461cad307aca9ea7024aea03be2377fc7d6da","user":{"login":"cmars","id":23741,"avatar_url":"https://avatars.githubusercontent.com/u/23741?v=3","gravatar_id":"","url":"https://api.github.com/users/cmars","html_url":"https://github.com/cmars","followers_url":"https://api.github.com/users/cmars/followers","following_url":"https://api.github.com/users/cmars/following{/other_user}","gists_url":"https://api.github.com/users/cmars/gists{/gist_id}","starred_url":"https://api.github.com/users/cmars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmars/subscriptions","organizations_url":"https://api.github.com/users/cmars/orgs","repos_url":"https://api.github.com/users/cmars/repos","events_url":"https://api.github.com/users/cmars/events{/privacy}","received_events_url":"https://api.github.com/users/cmars/received_events","type":"User","site_admin":false},"body":"Perfect.","created_at":"2015-11-11T15:40:03Z","updated_at":"2015-11-11T15:40:03Z","html_url":"https://github.com/juju/charmstore/pull/438#discussion_r44545761","pull_request_url":"https://api.github.com/repos/juju/charmstore/pulls/438","_links":{"self":{"href":"https://api.github.com/repos/juju/charmstore/pulls/comments/44545761"},"html":{"href":"https://github.com/juju/charmstore/pull/438#discussion_r44545761"},"pull_request":{"href":"https://api.github.com/repos/juju/charmstore/pulls/438"}}},"pull_request":{"url":"https://api.github.com/repos/juju/charmstore/pulls/438","id":49235270,"html_url":"https://github.com/juju/charmstore/pull/438","diff_url":"https://github.com/juju/charmstore/pull/438.diff","patch_url":"https://github.com/juju/charmstore/pull/438.patch","issue_url":"https://api.github.com/repos/juju/charmstore/issues/438","number":438,"state":"open","locked":false,"title":"User must agree to Terms and Conditions to access a charm.","user":{"login":"alesstimec","id":5555154,"avatar_url":"https://avatars.githubusercontent.com/u/5555154?v=3","gravatar_id":"","url":"https://api.github.com/users/alesstimec","html_url":"https://github.com/alesstimec","followers_url":"https://api.github.com/users/alesstimec/followers","following_url":"https://api.github.com/users/alesstimec/following{/other_user}","gists_url":"https://api.github.com/users/alesstimec/gists{/gist_id}","starred_url":"https://api.github.com/users/alesstimec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alesstimec/subscriptions","organizations_url":"https://api.github.com/users/alesstimec/orgs","repos_url":"https://api.github.com/users/alesstimec/repos","events_url":"https://api.github.com/users/alesstimec/events{/privacy}","received_events_url":"https://api.github.com/users/alesstimec/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-30T06:18:29Z","updated_at":"2015-11-11T15:40:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92e5b441026c5484e5bbf9a8a9c95901737892b5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juju/charmstore/pulls/438/commits","review_comments_url":"https://api.github.com/repos/juju/charmstore/pulls/438/comments","review_comment_url":"https://api.github.com/repos/juju/charmstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/charmstore/issues/438/comments","statuses_url":"https://api.github.com/repos/juju/charmstore/statuses/b9b461cad307aca9ea7024aea03be2377fc7d6da","head":{"label":"alesstimec:gate-on-terms-01","ref":"gate-on-terms-01","sha":"b9b461cad307aca9ea7024aea03be2377fc7d6da","user":{"login":"alesstimec","id":5555154,"avatar_url":"https://avatars.githubusercontent.com/u/5555154?v=3","gravatar_id":"","url":"https://api.github.com/users/alesstimec","html_url":"https://github.com/alesstimec","followers_url":"https://api.github.com/users/alesstimec/followers","following_url":"https://api.github.com/users/alesstimec/following{/other_user}","gists_url":"https://api.github.com/users/alesstimec/gists{/gist_id}","starred_url":"https://api.github.com/users/alesstimec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alesstimec/subscriptions","organizations_url":"https://api.github.com/users/alesstimec/orgs","repos_url":"https://api.github.com/users/alesstimec/repos","events_url":"https://api.github.com/users/alesstimec/events{/privacy}","received_events_url":"https://api.github.com/users/alesstimec/received_events","type":"User","site_admin":false},"repo":{"id":45125253,"name":"charmstore","full_name":"alesstimec/charmstore","owner":{"login":"alesstimec","id":5555154,"avatar_url":"https://avatars.githubusercontent.com/u/5555154?v=3","gravatar_id":"","url":"https://api.github.com/users/alesstimec","html_url":"https://github.com/alesstimec","followers_url":"https://api.github.com/users/alesstimec/followers","following_url":"https://api.github.com/users/alesstimec/following{/other_user}","gists_url":"https://api.github.com/users/alesstimec/gists{/gist_id}","starred_url":"https://api.github.com/users/alesstimec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alesstimec/subscriptions","organizations_url":"https://api.github.com/users/alesstimec/orgs","repos_url":"https://api.github.com/users/alesstimec/repos","events_url":"https://api.github.com/users/alesstimec/events{/privacy}","received_events_url":"https://api.github.com/users/alesstimec/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alesstimec/charmstore","description":"The charm store server.","fork":true,"url":"https://api.github.com/repos/alesstimec/charmstore","forks_url":"https://api.github.com/repos/alesstimec/charmstore/forks","keys_url":"https://api.github.com/repos/alesstimec/charmstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alesstimec/charmstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alesstimec/charmstore/teams","hooks_url":"https://api.github.com/repos/alesstimec/charmstore/hooks","issue_events_url":"https://api.github.com/repos/alesstimec/charmstore/issues/events{/number}","events_url":"https://api.github.com/repos/alesstimec/charmstore/events","assignees_url":"https://api.github.com/repos/alesstimec/charmstore/assignees{/user}","branches_url":"https://api.github.com/repos/alesstimec/charmstore/branches{/branch}","tags_url":"https://api.github.com/repos/alesstimec/charmstore/tags","blobs_url":"https://api.github.com/repos/alesstimec/charmstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alesstimec/charmstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alesstimec/charmstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/alesstimec/charmstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alesstimec/charmstore/statuses/{sha}","languages_url":"https://api.github.com/repos/alesstimec/charmstore/languages","stargazers_url":"https://api.github.com/repos/alesstimec/charmstore/stargazers","contributors_url":"https://api.github.com/repos/alesstimec/charmstore/contributors","subscribers_url":"https://api.github.com/repos/alesstimec/charmstore/subscribers","subscription_url":"https://api.github.com/repos/alesstimec/charmstore/subscription","commits_url":"https://api.github.com/repos/alesstimec/charmstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/alesstimec/charmstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/alesstimec/charmstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/alesstimec/charmstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/alesstimec/charmstore/contents/{+path}","compare_url":"https://api.github.com/repos/alesstimec/charmstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alesstimec/charmstore/merges","archive_url":"https://api.github.com/repos/alesstimec/charmstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alesstimec/charmstore/downloads","issues_url":"https://api.github.com/repos/alesstimec/charmstore/issues{/number}","pulls_url":"https://api.github.com/repos/alesstimec/charmstore/pulls{/number}","milestones_url":"https://api.github.com/repos/alesstimec/charmstore/milestones{/number}","notifications_url":"https://api.github.com/repos/alesstimec/charmstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alesstimec/charmstore/labels{/name}","releases_url":"https://api.github.com/repos/alesstimec/charmstore/releases{/id}","created_at":"2015-10-28T16:13:52Z","updated_at":"2015-10-28T16:13:53Z","pushed_at":"2015-11-11T15:39:00Z","git_url":"git://github.com/alesstimec/charmstore.git","ssh_url":"git@github.com:alesstimec/charmstore.git","clone_url":"https://github.com/alesstimec/charmstore.git","svn_url":"https://github.com/alesstimec/charmstore","homepage":null,"size":2901,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"v5-unstable"}},"base":{"label":"juju:v5-terms","ref":"v5-terms","sha":"d9d31dee3eec13b03a88a487e861a21ff75c18b2","user":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=3","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"repo":{"id":20720417,"name":"charmstore","full_name":"juju/charmstore","owner":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=3","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju/charmstore","description":"The charm store server.","fork":false,"url":"https://api.github.com/repos/juju/charmstore","forks_url":"https://api.github.com/repos/juju/charmstore/forks","keys_url":"https://api.github.com/repos/juju/charmstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/charmstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/charmstore/teams","hooks_url":"https://api.github.com/repos/juju/charmstore/hooks","issue_events_url":"https://api.github.com/repos/juju/charmstore/issues/events{/number}","events_url":"https://api.github.com/repos/juju/charmstore/events","assignees_url":"https://api.github.com/repos/juju/charmstore/assignees{/user}","branches_url":"https://api.github.com/repos/juju/charmstore/branches{/branch}","tags_url":"https://api.github.com/repos/juju/charmstore/tags","blobs_url":"https://api.github.com/repos/juju/charmstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/charmstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/charmstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/charmstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/charmstore/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/charmstore/languages","stargazers_url":"https://api.github.com/repos/juju/charmstore/stargazers","contributors_url":"https://api.github.com/repos/juju/charmstore/contributors","subscribers_url":"https://api.github.com/repos/juju/charmstore/subscribers","subscription_url":"https://api.github.com/repos/juju/charmstore/subscription","commits_url":"https://api.github.com/repos/juju/charmstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/charmstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/charmstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/charmstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju/charmstore/contents/{+path}","compare_url":"https://api.github.com/repos/juju/charmstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/charmstore/merges","archive_url":"https://api.github.com/repos/juju/charmstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/charmstore/downloads","issues_url":"https://api.github.com/repos/juju/charmstore/issues{/number}","pulls_url":"https://api.github.com/repos/juju/charmstore/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/charmstore/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/charmstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/charmstore/labels{/name}","releases_url":"https://api.github.com/repos/juju/charmstore/releases{/id}","created_at":"2014-06-11T09:53:37Z","updated_at":"2015-05-08T13:47:14Z","pushed_at":"2015-11-11T15:39:01Z","git_url":"git://github.com/juju/charmstore.git","ssh_url":"git@github.com:juju/charmstore.git","clone_url":"https://github.com/juju/charmstore.git","svn_url":"https://github.com/juju/charmstore","homepage":null,"size":6427,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":17,"forks":15,"open_issues":17,"watchers":6,"default_branch":"v5-unstable"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/charmstore/pulls/438"},"html":{"href":"https://github.com/juju/charmstore/pull/438"},"issue":{"href":"https://api.github.com/repos/juju/charmstore/issues/438"},"comments":{"href":"https://api.github.com/repos/juju/charmstore/issues/438/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/charmstore/pulls/438/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/charmstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/charmstore/pulls/438/commits"},"statuses":{"href":"https://api.github.com/repos/juju/charmstore/statuses/b9b461cad307aca9ea7024aea03be2377fc7d6da"}}}}