Browse Source

nextcloud: Add tests for downloading and deleting WebDAV file

pull/393/head
jld3103 1 year ago
parent
commit
75db77dee1
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 13
      packages/nextcloud/test/webdav.dart

13
packages/nextcloud/test/webdav.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:crypto/crypto.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:test/test.dart';
@ -141,6 +142,18 @@ Future run(final DockerImage image) async {
);
});
test('Download file', () async {
final response = await client.webdav.download('Nextcloud.png');
expect(sha1.convert(response).toString(), '5ab8040bc0e9a3c47f45abd8a6d44f6e381ba6ed');
});
test('Delete file', () async {
final response = await client.webdav.delete('Nextcloud.png');
expect(response.statusCode, 204);
final responses = (await client.webdav.ls('/')).responses;
expect(responses.where((final response) => response.href!.endsWith('/Nextcloud.png')), hasLength(0));
});
test('Copy file', () async {
final response = await client.webdav.copy(
'Nextcloud.png',

Loading…
Cancel
Save