| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library pub_uploader_test; | 5 library pub_uploader_test; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:scheduled_test/scheduled_process.dart'; | 10 import 'package:scheduled_test/scheduled_process.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 Manage uploaders for a package on pub.dartlang.org. | 22 Manage uploaders for a package on pub.dartlang.org. |
| 23 | 23 |
| 24 Usage: pub uploader [options] {add/remove} <email> | 24 Usage: pub uploader [options] {add/remove} <email> |
| 25 -h, --help Print usage information for this command. | 25 -h, --help Print usage information for this command. |
| 26 --server The package server on which the package is hosted. | 26 --server The package server on which the package is hosted. |
| 27 (defaults to "https://pub.dartlang.org") | 27 (defaults to "https://pub.dartlang.org") |
| 28 | 28 |
| 29 --package The package whose uploaders will be modified. | 29 --package The package whose uploaders will be modified. |
| 30 (defaults to the current package) | 30 (defaults to the current package) |
| 31 | 31 |
| 32 Run "pub help" to see global options. |
| 32 See http://dartlang.org/tools/pub/cmd/pub-uploader.html for detailed documentati
on. | 33 See http://dartlang.org/tools/pub/cmd/pub-uploader.html for detailed documentati
on. |
| 33 '''; | 34 '''; |
| 34 | 35 |
| 35 ScheduledProcess startPubUploader(ScheduledServer server, List<String> args) { | 36 ScheduledProcess startPubUploader(ScheduledServer server, List<String> args) { |
| 36 var tokenEndpoint = server.url.then((url) => | 37 var tokenEndpoint = server.url.then((url) => |
| 37 url.resolve('/token').toString()); | 38 url.resolve('/token').toString()); |
| 38 args = flatten(['uploader', '--server', tokenEndpoint, args]); | 39 args = flatten(['uploader', '--server', tokenEndpoint, args]); |
| 39 return startPub(args: args, tokenEndpoint: tokenEndpoint); | 40 return startPub(args: args, tokenEndpoint: tokenEndpoint); |
| 40 } | 41 } |
| 41 | 42 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 163 |
| 163 server.handle('DELETE', '/api/packages/pkg/uploaders/email', | 164 server.handle('DELETE', '/api/packages/pkg/uploaders/email', |
| 164 (request) => new shelf.Response.ok("{not json")); | 165 (request) => new shelf.Response.ok("{not json")); |
| 165 | 166 |
| 166 pub.stderr.expect(emitsLines( | 167 pub.stderr.expect(emitsLines( |
| 167 'Invalid server response:\n' | 168 'Invalid server response:\n' |
| 168 '{not json')); | 169 '{not json')); |
| 169 pub.shouldExit(1); | 170 pub.shouldExit(1); |
| 170 }); | 171 }); |
| 171 } | 172 } |
| OLD | NEW |