diff --git a/packages/nextcloud/bin/generate_props.dart b/packages/nextcloud/bin/generate_props.dart index 3c577449..cec196e0 100644 --- a/packages/nextcloud/bin/generate_props.dart +++ b/packages/nextcloud/bin/generate_props.dart @@ -22,6 +22,7 @@ void main() { File('lib/src/webdav/props.dart').writeAsStringSync( [ '// ignore_for_file: public_member_api_docs', + '// coverage:ignore-file', "import 'package:nextcloud/src/webdav/webdav.dart';", "import 'package:xml/xml.dart';", "import 'package:xml_annotation/xml_annotation.dart' as annotation;", diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index 86e44b4c..1bce6929 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -65,7 +65,7 @@ class WebDavClient { part = part.substring(1); } while (part.endsWith('/')) { - part = part.substring(0, part.length - 1); + part = part.substring(0, part.length - 1); // coverage:ignore-line } return part; }) @@ -116,7 +116,7 @@ class WebDavClient { return null; } if (remotePath.trim().startsWith('/')) { - dirs[0] = '/${dirs[0]}'; + dirs[0] = '/${dirs[0]}'; // coverage:ignore-line } final prevPath = StringBuffer(); late HttpClientResponse response; @@ -245,11 +245,13 @@ class WebDavClient { }, ); if (response.statusCode == 301) { + // coverage:ignore-start return ls( response.headers['location']!.first, prop: prop, depth: depth, ); + // coverage:ignore-end } return _parseResponse(response); } @@ -272,7 +274,7 @@ class WebDavClient { utf8.encode( WebDavOcFilterFiles( filterRules: filterRules, - prop: prop ?? WebDavPropfindProp(), + prop: prop ?? WebDavPropfindProp(), // coverage:ignore-line ).toXmlElement(namespaces: namespaces).toXmlString(), ), ), diff --git a/packages/nextcloud/lib/src/webdav/props.dart b/packages/nextcloud/lib/src/webdav/props.dart index df63ad55..e35e9506 100644 --- a/packages/nextcloud/lib/src/webdav/props.dart +++ b/packages/nextcloud/lib/src/webdav/props.dart @@ -1,4 +1,5 @@ // ignore_for_file: public_member_api_docs +// coverage:ignore-file import 'package:nextcloud/src/webdav/webdav.dart'; import 'package:xml/xml.dart'; import 'package:xml_annotation/xml_annotation.dart' as annotation; diff --git a/packages/nextcloud/lib/src/webdav/webdav.dart b/packages/nextcloud/lib/src/webdav/webdav.dart index c226cbdf..6a7932a5 100644 --- a/packages/nextcloud/lib/src/webdav/webdav.dart +++ b/packages/nextcloud/lib/src/webdav/webdav.dart @@ -1,4 +1,5 @@ // ignore_for_file: public_member_api_docs +// coverage:ignore-file import 'package:intl/intl.dart'; import 'package:nextcloud/src/webdav/props.dart'; @@ -78,9 +79,6 @@ class WebDavPropertyupdate with _$WebDavPropertyupdateXmlSerializableMixin { required this.set, }); - factory WebDavPropertyupdate.fromXmlElement(final XmlElement element) => - _$WebDavPropertyupdateFromXmlElement(element); - @annotation.XmlElement(name: 'set', namespace: namespaceDav) final WebDavSet set; } @@ -95,7 +93,7 @@ class WebDavSet with _$WebDavSetXmlSerializableMixin { factory WebDavSet.fromXmlElement(final XmlElement element) => _$WebDavSetFromXmlElement(element); @annotation.XmlElement(name: 'prop', namespace: namespaceDav) - final WebDavProp prop; + final WebDavProp prop; // coverage:ignore-line } @annotation.XmlSerializable(createMixin: true) @@ -105,8 +103,6 @@ class WebDavPropfind with _$WebDavPropfindXmlSerializableMixin { required this.prop, }); - factory WebDavPropfind.fromXmlElement(final XmlElement element) => _$WebDavPropfindFromXmlElement(element); - @annotation.XmlElement(name: 'prop', namespace: namespaceDav) final WebDavPropfindProp prop; } @@ -119,8 +115,6 @@ class WebDavOcFilterFiles with _$WebDavOcFilterFilesXmlSerializableMixin { required this.prop, }); - factory WebDavOcFilterFiles.fromXmlElement(final XmlElement element) => _$WebDavOcFilterFilesFromXmlElement(element); - @annotation.XmlElement(name: 'filter-rules', namespace: namespaceOwncloud) final WebDavOcFilterRules filterRules;