Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: utils/tests/pub/oauth2_test.dart

Issue 11557008: Make pub publish more user friendly: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge in path changes. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/tests/pub/directory_tree_test.dart ('k') | utils/tests/pub/path/path_posix_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/oauth2_test.dart
diff --git a/utils/tests/pub/oauth2_test.dart b/utils/tests/pub/oauth2_test.dart
index 32e4a75a729b647d628df36057dccc226a2699a5..f640e114326546ec17a87bafb05d7e2224cdcfc7 100644
--- a/utils/tests/pub/oauth2_test.dart
+++ b/utils/tests/pub/oauth2_test.dart
@@ -21,6 +21,7 @@ main() {
() {
var server = new ScheduledServer();
var pub = startPubLish(server);
+ confirmPublish(pub);
authorizePub(pub, server);
server.handle('GET', '/packages/versions/new.json', (request, response) {
@@ -41,6 +42,7 @@ main() {
var server = new ScheduledServer();
credentialsFile(server, 'access token').scheduleCreate();
var pub = startPubLish(server);
+ confirmPublish(pub);
server.handle('GET', '/packages/versions/new.json', (request, response) {
expect(request.headers.value('authorization'),
@@ -63,6 +65,7 @@ main() {
.scheduleCreate();
var pub = startPubLish(server);
+ confirmPublish(pub);
server.handle('POST', '/token', (request, response) {
return consumeInputStream(request.inputStream).transform((bytes) {
@@ -102,6 +105,7 @@ main() {
.scheduleCreate();
var pub = startPubLish(server);
+ confirmPublish(pub);
expectLater(pub.nextErrLine(), equals("Pub's authorization to upload "
"packages has expired and can't be automatically refreshed."));
@@ -129,6 +133,7 @@ main() {
]).scheduleCreate();
var pub = startPubLish(server);
+ confirmPublish(pub);
authorizePub(pub, server, "new access token");
server.handle('GET', '/packages/versions/new.json', (request, response) {
@@ -148,8 +153,12 @@ main() {
void authorizePub(ScheduledProcess pub, ScheduledServer server,
[String accessToken="access token"]) {
- expectLater(pub.nextLine(), equals('Pub needs your '
- 'authorization to upload packages on your behalf.'));
+ // TODO(rnystrom): The confirm line is run together with this one because
+ // in normal usage, the user will have entered a newline on stdin which
+ // gets echoed to the terminal. Do something better here?
+ expectLater(pub.nextLine(), equals(
+ 'Looks great! Are you ready to upload your package (y/n)? '
+ 'Pub needs your authorization to upload packages on your behalf.'));
expectLater(pub.nextLine().chain((line) {
var match = new RegExp(r'[?&]redirect_uri=([0-9a-zA-Z%+-]+)[$&]')
« no previous file with comments | « utils/tests/pub/directory_tree_test.dart ('k') | utils/tests/pub/path/path_posix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698