Merge lp:~dobey/unity-scope-click/sign-all into lp:unity-scope-click

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 359
Merged at revision: 362
Proposed branch: lp:~dobey/unity-scope-click/sign-all
Merge into: lp:unity-scope-click
Diff against target: 68 lines (+38/-2)
2 files modified
libclickscope/click/index.cpp (+2/-2)
libclickscope/tests/test_index.cpp (+36/-0)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/sign-all
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Alejandro J. Cura (community) Approve
Review via email: mp+267712@code.launchpad.net

Commit message

Sign the requests to CPI by default.
Add tests to ensure signing is requested.

To post a comment you must log in.
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libclickscope/click/index.cpp'
--- libclickscope/click/index.cpp 2015-06-12 21:43:36 +0000
+++ libclickscope/click/index.cpp 2015-08-11 20:19:38 +0000
@@ -152,7 +152,7 @@
152 const std::string built_query(build_index_query(query, ""));152 const std::string built_query(build_index_query(query, ""));
153 params.add(click::QUERY_ARGNAME, built_query.c_str());153 params.add(click::QUERY_ARGNAME, built_query.c_str());
154 QSharedPointer<click::web::Response> response(client->call(154 QSharedPointer<click::web::Response> response(client->call(
155 get_base_url() + click::SEARCH_PATH, "GET", false, build_headers(), "", params));155 get_base_url() + click::SEARCH_PATH, "GET", true, build_headers(), "", params));
156156
157 QObject::connect(response.data(), &click::web::Response::finished, [=](QString reply) {157 QObject::connect(response.data(), &click::web::Response::finished, [=](QString reply) {
158 std::pair<Packages, Packages> package_lists;158 std::pair<Packages, Packages> package_lists;
@@ -179,7 +179,7 @@
179{179{
180 click::web::CallParams params;180 click::web::CallParams params;
181 QSharedPointer<click::web::Response> response(client->call(181 QSharedPointer<click::web::Response> response(client->call(
182 department_href, "GET", false, build_headers(), "", params));182 department_href, "GET", true, build_headers(), "", params));
183183
184 QObject::connect(response.data(), &click::web::Response::finished, [=](QString reply) {184 QObject::connect(response.data(), &click::web::Response::finished, [=](QString reply) {
185 qDebug() << "departments request finished";185 qDebug() << "departments request finished";
186186
=== modified file 'libclickscope/tests/test_index.cpp'
--- libclickscope/tests/test_index.cpp 2014-08-11 18:30:00 +0000
+++ libclickscope/tests/test_index.cpp 2015-08-11 20:19:38 +0000
@@ -104,6 +104,42 @@
104 indexPtr->search("", [](click::Packages, click::Packages) {});104 indexPtr->search("", [](click::Packages, click::Packages) {});
105}105}
106106
107TEST_F(IndexTest, testSearchSignsCall)
108{
109 LifetimeHelper<click::network::Reply, MockNetworkReply> reply;
110 auto response = responseForReply(reply.asSharedPtr());
111
112 EXPECT_CALL(*clientPtr, callImpl(_, _, true, _, _, _))
113 .Times(1)
114 .WillOnce(Return(response));
115
116 indexPtr->search("", [](click::Packages, click::Packages) {});
117}
118
119TEST_F(IndexTest, testBootstrapSignsCall)
120{
121 LifetimeHelper<click::network::Reply, MockNetworkReply> reply;
122 auto response = responseForReply(reply.asSharedPtr());
123
124 EXPECT_CALL(*clientPtr, callImpl(_, _, true, _, _, _))
125 .Times(1)
126 .WillOnce(Return(response));
127
128 indexPtr->bootstrap([](const click::DepartmentList&, const click::HighlightList&, click::Index::Error, int) {});
129}
130
131TEST_F(IndexTest, testDepartmentsSignsCall)
132{
133 LifetimeHelper<click::network::Reply, MockNetworkReply> reply;
134 auto response = responseForReply(reply.asSharedPtr());
135
136 EXPECT_CALL(*clientPtr, callImpl(_, _, true, _, _, _))
137 .Times(1)
138 .WillOnce(Return(response));
139
140 indexPtr->departments("departments", [](const click::DepartmentList&, const click::HighlightList&, click::Index::Error, int) {});
141}
142
107TEST_F(IndexTest, testSearchSendsBuiltQueryAsParam)143TEST_F(IndexTest, testSearchSendsBuiltQueryAsParam)
108{144{
109 const std::string FAKE_BUILT_QUERY = "FAKE_QUERY,frameworks:fake-14.04,architecture:fake-arch";145 const std::string FAKE_BUILT_QUERY = "FAKE_QUERY,frameworks:fake-14.04,architecture:fake-arch";

Subscribers

People subscribed via source and target branches

to all changes: