Browse Source

Merge pull request #491 from provokateurin/cleanup/tests

Cleanup/tests
pull/490/head
Kate 1 year ago committed by GitHub
parent
commit
db5c8c721c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      packages/nextcloud/test/core_test.dart
  2. 21
      packages/nextcloud/test/news_test.dart
  3. 12
      packages/nextcloud/test/notes_test.dart
  4. 15
      packages/nextcloud/test/notifications_test.dart
  5. 12
      packages/nextcloud/test/provisioning_api_test.dart
  6. 12
      packages/nextcloud/test/uppush_test.dart
  7. 12
      packages/nextcloud/test/user_status_test.dart
  8. 12
      packages/nextcloud/test/webdav_test.dart

12
packages/nextcloud/test/core_test.dart

@ -1,14 +1,16 @@
@Retry(3)
library core_test;
import 'package:nextcloud/nextcloud.dart'; import 'package:nextcloud/nextcloud.dart';
import 'package:test/test.dart'; 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 {

21
packages/nextcloud/test/news_test.dart

@ -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',
); );

12
packages/nextcloud/test/notes_test.dart

@ -1,14 +1,16 @@
@Retry(3)
library notes_test;
import 'package:nextcloud/nextcloud.dart'; import 'package:nextcloud/nextcloud.dart';
import 'package:test/test.dart'; 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 {

15
packages/nextcloud/test/notifications_test.dart

@ -1,3 +1,6 @@
@Retry(3)
library notifications_test;
import 'dart:async'; import 'dart:async';
import 'package:nextcloud/nextcloud.dart'; import 'package:nextcloud/nextcloud.dart';
@ -5,12 +8,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 +101,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 {

12
packages/nextcloud/test/provisioning_api_test.dart

@ -1,13 +1,15 @@
@Retry(3)
library provisioning_api_test;
import 'package:test/test.dart'; 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 {

12
packages/nextcloud/test/uppush_test.dart

@ -1,13 +1,15 @@
@Retry(3)
library uppush_test;
import 'package:test/test.dart'; 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 {

12
packages/nextcloud/test/user_status_test.dart

@ -1,14 +1,16 @@
@Retry(3)
library user_status_test;
import 'package:nextcloud/nextcloud.dart'; import 'package:nextcloud/nextcloud.dart';
import 'package:test/test.dart'; 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 {

12
packages/nextcloud/test/webdav_test.dart

@ -1,3 +1,6 @@
@Retry(3)
library webdav_test;
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:typed_data'; import 'dart:typed_data';
@ -7,12 +10,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