Browse Source

refactor(nextcloud): Remove test wrapping

pull/491/head
jld3103 1 year ago
parent
commit
3b11c70187
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 9
      packages/nextcloud/test/core_test.dart
  2. 18
      packages/nextcloud/test/news_test.dart
  3. 9
      packages/nextcloud/test/notes_test.dart
  4. 12
      packages/nextcloud/test/notifications_test.dart
  5. 9
      packages/nextcloud/test/provisioning_api_test.dart
  6. 9
      packages/nextcloud/test/uppush_test.dart
  7. 9
      packages/nextcloud/test/user_status_test.dart
  8. 9
      packages/nextcloud/test/webdav_test.dart

9
packages/nextcloud/test/core_test.dart

@ -3,12 +3,11 @@ 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('core', () { group('core', () {
late DockerImage image;
setUpAll(() async => image = await getDockerImage());
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;
setUp(() async { setUp(() async {

18
packages/nextcloud/test/news_test.dart

@ -6,15 +6,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 +24,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',
); );

9
packages/nextcloud/test/notes_test.dart

@ -3,12 +3,11 @@ 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('notes', () { group('notes', () {
late DockerImage image;
setUpAll(() async => image = await getDockerImage());
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;
setUp(() async { setUp(() async {

12
packages/nextcloud/test/notifications_test.dart

@ -5,12 +5,11 @@ 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('notifications', () { group('notifications', () {
late DockerImage image;
setUpAll(() async => image = await getDockerImage());
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;
setUp(() async { setUp(() async {
@ -99,6 +98,9 @@ Future run(final DockerImage image) async {
}); });
group('push notifications', () { group('push notifications', () {
late DockerImage image;
setUpAll(() async => image = await getDockerImage());
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;
setUp(() async { setUp(() async {

9
packages/nextcloud/test/provisioning_api_test.dart

@ -2,12 +2,11 @@ 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('provisioning_api', () { group('provisioning_api', () {
late DockerImage image;
setUpAll(() async => image = await getDockerImage());
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;
setUp(() async { setUp(() async {

9
packages/nextcloud/test/uppush_test.dart

@ -2,12 +2,11 @@ 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('uppush', () { group('uppush', () {
late DockerImage image;
setUpAll(() async => image = await getDockerImage());
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;
setUp(() async { setUp(() async {

9
packages/nextcloud/test/user_status_test.dart

@ -3,12 +3,11 @@ 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('user_status', () { group('user_status', () {
late DockerImage image;
setUpAll(() async => image = await getDockerImage());
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;
setUp(() async { setUp(() async {

9
packages/nextcloud/test/webdav_test.dart

@ -7,12 +7,11 @@ 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('webdav', () { group('webdav', () {
late DockerImage image;
setUpAll(() async => image = await getDockerImage());
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;
setUp(() async { setUp(() async {

Loading…
Cancel
Save