|
|
@ -1,3 +1,6 @@ |
|
|
|
|
|
|
|
@Retry(3) |
|
|
|
|
|
|
|
library news_test; |
|
|
|
|
|
|
|
|
|
|
|
import 'dart:async'; |
|
|
|
import 'dart:async'; |
|
|
|
import 'dart:io'; |
|
|
|
import 'dart:io'; |
|
|
|
|
|
|
|
|
|
|
@ -6,15 +9,15 @@ import 'package:test/test.dart'; |
|
|
|
|
|
|
|
|
|
|
|
import 'helper.dart'; |
|
|
|
import 'helper.dart'; |
|
|
|
|
|
|
|
|
|
|
|
Future main() async { |
|
|
|
void main() { |
|
|
|
await run(await getDockerImage()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future run(final DockerImage image) async { |
|
|
|
|
|
|
|
group('news', () { |
|
|
|
group('news', () { |
|
|
|
|
|
|
|
late DockerImage image; |
|
|
|
late HttpServer rssServer; |
|
|
|
late HttpServer rssServer; |
|
|
|
setUpAll(() async => rssServer = await getRssServer()); |
|
|
|
setUpAll(() async { |
|
|
|
tearDownAll(() => rssServer.close(force: true)); |
|
|
|
image = await getDockerImage(); |
|
|
|
|
|
|
|
rssServer = await getRssServer(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
tearDownAll(() async => rssServer.close(force: true)); |
|
|
|
|
|
|
|
|
|
|
|
late DockerContainer container; |
|
|
|
late DockerContainer container; |
|
|
|
late TestNextcloudClient client; |
|
|
|
late TestNextcloudClient client; |
|
|
@ -24,12 +27,12 @@ Future run(final DockerImage image) async { |
|
|
|
}); |
|
|
|
}); |
|
|
|
tearDown(() => container.destroy()); |
|
|
|
tearDown(() => container.destroy()); |
|
|
|
|
|
|
|
|
|
|
|
Future<NewsListFeeds> addWikipediaFeed([final int? folderID]) => client.news.addFeed( |
|
|
|
Future<NewsListFeeds> addWikipediaFeed([final int? folderID]) async => client.news.addFeed( |
|
|
|
url: 'http://host.docker.internal:${rssServer.port}/wikipedia.xml', |
|
|
|
url: 'http://host.docker.internal:${rssServer.port}/wikipedia.xml', |
|
|
|
folderId: folderID, |
|
|
|
folderId: folderID, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
Future<NewsListFeeds> addNasaFeed() => client.news.addFeed( |
|
|
|
Future<NewsListFeeds> addNasaFeed() async => client.news.addFeed( |
|
|
|
url: 'http://host.docker.internal:${rssServer.port}/nasa.xml', |
|
|
|
url: 'http://host.docker.internal:${rssServer.port}/nasa.xml', |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|