Browse Source

nextcloud: Add missing coverage ignores for WebDAV

pull/392/head
jld3103 2 years ago
parent
commit
1ab7c70151
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 1
      packages/nextcloud/bin/generate_props.dart
  2. 8
      packages/nextcloud/lib/src/webdav/client.dart
  3. 1
      packages/nextcloud/lib/src/webdav/props.dart
  4. 10
      packages/nextcloud/lib/src/webdav/webdav.dart

1
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;",

8
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(),
),
),

1
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;

10
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;

Loading…
Cancel
Save