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 10 matching lines...) Expand all Loading... |
21 final USAGE_STRING = ''' | 21 final USAGE_STRING = ''' |
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 |
| 32 See http://dartlang.org/tools/pub/cmd/pub-uploader.html for detailed documentati
on. |
31 '''; | 33 '''; |
32 | 34 |
33 ScheduledProcess startPubUploader(ScheduledServer server, List<String> args) { | 35 ScheduledProcess startPubUploader(ScheduledServer server, List<String> args) { |
34 var tokenEndpoint = server.url.then((url) => | 36 var tokenEndpoint = server.url.then((url) => |
35 url.resolve('/token').toString()); | 37 url.resolve('/token').toString()); |
36 args = flatten(['uploader', '--server', tokenEndpoint, args]); | 38 args = flatten(['uploader', '--server', tokenEndpoint, args]); |
37 return startPub(args: args, tokenEndpoint: tokenEndpoint); | 39 return startPub(args: args, tokenEndpoint: tokenEndpoint); |
38 } | 40 } |
39 | 41 |
40 main() { | 42 main() { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 162 |
161 server.handle('DELETE', '/api/packages/pkg/uploaders/email', | 163 server.handle('DELETE', '/api/packages/pkg/uploaders/email', |
162 (request) => new shelf.Response.ok("{not json")); | 164 (request) => new shelf.Response.ok("{not json")); |
163 | 165 |
164 pub.stderr.expect(emitsLines( | 166 pub.stderr.expect(emitsLines( |
165 'Invalid server response:\n' | 167 'Invalid server response:\n' |
166 '{not json')); | 168 '{not json')); |
167 pub.shouldExit(1); | 169 pub.shouldExit(1); |
168 }); | 170 }); |
169 } | 171 } |
OLD | NEW |