OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 pubserver.shelf_pubserver_test; | 5 library pub_server.shelf_pubserver_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 | 9 |
10 import 'package:shelf/shelf.dart' as shelf; | 10 import 'package:shelf/shelf.dart' as shelf; |
11 import 'package:pubserver/repository.dart'; | 11 import 'package:pub_server/repository.dart'; |
12 import 'package:pubserver/shelf_pubserver.dart'; | 12 import 'package:pub_server/shelf_pubserver.dart'; |
13 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
14 | 14 |
15 class RepositoryMock implements PackageRepository { | 15 class RepositoryMock implements PackageRepository { |
16 final Function downloadFun; | 16 final Function downloadFun; |
17 final Function downloadUrlFun; | 17 final Function downloadUrlFun; |
18 final Function finishAsyncUploadFun; | 18 final Function finishAsyncUploadFun; |
19 final Function lookupVersionFun; | 19 final Function lookupVersionFun; |
20 final Function startAsyncUploadFun; | 20 final Function startAsyncUploadFun; |
21 final Function uploadFun; | 21 final Function uploadFun; |
22 final Function versionsFun; | 22 final Function versionsFun; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 var mock = new RepositoryMock(); | 362 var mock = new RepositoryMock(); |
363 var server = new ShelfPubServer(mock); | 363 var server = new ShelfPubServer(mock); |
364 var request = new shelf.Request('GET', newUrl); | 364 var request = new shelf.Request('GET', newUrl); |
365 var response = await server.requestHandler(request); | 365 var response = await server.requestHandler(request); |
366 | 366 |
367 expect(response.statusCode, equals(404)); | 367 expect(response.statusCode, equals(404)); |
368 }); | 368 }); |
369 }); | 369 }); |
370 }); | 370 }); |
371 } | 371 } |
OLD | NEW |