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

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

Issue 11830017: Fix ALL the pub tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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
Index: utils/tests/pub/pub_lish_test.dart
diff --git a/utils/tests/pub/pub_lish_test.dart b/utils/tests/pub/pub_lish_test.dart
index 5319c4667857e140c9a6c72957e70454d367c482..babba9ea8b3a3032eea9f6dcb99965b0c849c740 100644
--- a/utils/tests/pub/pub_lish_test.dart
+++ b/utils/tests/pub/pub_lish_test.dart
@@ -5,7 +5,7 @@
library pub_lish_test;
import 'dart:io';
-import 'dart:json';
+import 'dart:json' as json;
import 'test_pub.dart';
import '../../../pkg/unittest/lib/unittest.dart';
@@ -28,7 +28,7 @@ void handleUploadForm(ScheduledServer server, [Map body]) {
}
response.headers.contentType = new ContentType("application", "json");
- response.outputStream.writeString(JSON.stringify(body));
+ response.outputStream.writeString(json.stringify(body));
response.outputStream.close();
});
});
@@ -59,7 +59,7 @@ main() {
handleUpload(server);
server.handle('GET', '/create', (request, response) {
- response.outputStream.writeString(JSON.stringify({
+ response.outputStream.writeString(json.stringify({
'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
}));
response.outputStream.close();
@@ -123,7 +123,7 @@ main() {
handleUpload(server);
server.handle('GET', '/create', (request, response) {
- response.outputStream.writeString(JSON.stringify({
+ response.outputStream.writeString(json.stringify({
'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
}));
response.outputStream.close();
@@ -145,7 +145,7 @@ main() {
server.handle('GET', '/packages/versions/new.json', (request, response) {
response.statusCode = 400;
- response.outputStream.writeString(JSON.stringify({
+ response.outputStream.writeString(json.stringify({
'error': {'message': 'your request sucked'}
}));
response.outputStream.close();
@@ -192,7 +192,7 @@ main() {
handleUploadForm(server, body);
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
- expectLater(pub.nextErrLine(), equals(JSON.stringify(body)));
+ expectLater(pub.nextErrLine(), equals(json.stringify(body)));
pub.shouldExit(1);
run();
@@ -215,7 +215,7 @@ main() {
handleUploadForm(server, body);
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
- expectLater(pub.nextErrLine(), equals(JSON.stringify(body)));
+ expectLater(pub.nextErrLine(), equals(json.stringify(body)));
pub.shouldExit(1);
run();
@@ -231,7 +231,7 @@ main() {
var body = {'url': 'http://example.com/upload'};
handleUploadForm(server, body);
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
- expectLater(pub.nextErrLine(), equals(JSON.stringify(body)));
+ expectLater(pub.nextErrLine(), equals(json.stringify(body)));
pub.shouldExit(1);
run();
@@ -247,7 +247,7 @@ main() {
var body = {'url': 'http://example.com/upload', 'fields': 12};
handleUploadForm(server, body);
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
- expectLater(pub.nextErrLine(), equals(JSON.stringify(body)));
+ expectLater(pub.nextErrLine(), equals(json.stringify(body)));
pub.shouldExit(1);
run();
@@ -266,7 +266,7 @@ main() {
};
handleUploadForm(server, body);
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
- expectLater(pub.nextErrLine(), equals(JSON.stringify(body)));
+ expectLater(pub.nextErrLine(), equals(json.stringify(body)));
pub.shouldExit(1);
run();
@@ -326,7 +326,7 @@ main() {
server.handle('GET', '/create', (request, response) {
response.statusCode = 400;
- response.outputStream.writeString(JSON.stringify({
+ response.outputStream.writeString(json.stringify({
'error': {'message': 'Your package was too boring.'}
}));
response.outputStream.close();
@@ -371,12 +371,12 @@ main() {
var body = {'error': 'Your package was too boring.'};
server.handle('GET', '/create', (request, response) {
response.statusCode = 400;
- response.outputStream.writeString(JSON.stringify(body));
+ response.outputStream.writeString(json.stringify(body));
response.outputStream.close();
});
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
- expectLater(pub.nextErrLine(), equals(JSON.stringify(body)));
+ expectLater(pub.nextErrLine(), equals(json.stringify(body)));
pub.shouldExit(1);
run();
@@ -393,12 +393,12 @@ main() {
var body = {'success': 'Your package was awesome.'};
server.handle('GET', '/create', (request, response) {
- response.outputStream.writeString(JSON.stringify(body));
+ response.outputStream.writeString(json.stringify(body));
response.outputStream.close();
});
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
- expectLater(pub.nextErrLine(), equals(JSON.stringify(body)));
+ expectLater(pub.nextErrLine(), equals(json.stringify(body)));
pub.shouldExit(1);
run();

Powered by Google App Engine
This is Rietveld 408576698