Remote sync of webdav
This commit is contained in:
parent
f01186df79
commit
483fbeafb6
44 changed files with 4842 additions and 975 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fuel_tax_tracker/services/drive_service.dart' show DriveLockFile;
|
||||
import 'package:fuel_tax_tracker/services/cloud/cloud_storage_provider.dart' show CloudLockFile;
|
||||
import 'package:fuel_tax_tracker/services/lock_coordinator.dart';
|
||||
|
||||
void main() {
|
||||
|
|
@ -16,7 +16,7 @@ void main() {
|
|||
return 'id';
|
||||
},
|
||||
listLocks: () async =>
|
||||
[DriveLockFile(id: 'id', username: 'me@example.com', createdAtUtc: now)],
|
||||
[CloudLockFile(id: 'id', username: 'me@example.com', createdAtUtc: now)],
|
||||
deleteLock: (_) async {},
|
||||
delay: (_) async {},
|
||||
);
|
||||
|
|
@ -35,7 +35,7 @@ void main() {
|
|||
createLock: (_) async => 'my-lock-id',
|
||||
listLocks: () async {
|
||||
listCallCount++;
|
||||
return [DriveLockFile(id: 'my-lock-id', username: 'me', createdAtUtc: now)];
|
||||
return [CloudLockFile(id: 'my-lock-id', username: 'me', createdAtUtc: now)];
|
||||
},
|
||||
deleteLock: (_) async {},
|
||||
delay: (d) async => delayCalls.add(d),
|
||||
|
|
@ -55,8 +55,8 @@ void main() {
|
|||
nowUtc: () => now,
|
||||
createLock: (_) async => 'mine',
|
||||
listLocks: () async => [
|
||||
DriveLockFile(id: 'mine', username: 'me', createdAtUtc: now),
|
||||
DriveLockFile(
|
||||
CloudLockFile(id: 'mine', username: 'me', createdAtUtc: now),
|
||||
CloudLockFile(
|
||||
id: 'newer', username: 'other', createdAtUtc: now.add(const Duration(seconds: 5))),
|
||||
],
|
||||
deleteLock: (_) async {},
|
||||
|
|
@ -81,14 +81,14 @@ void main() {
|
|||
listCallCount++;
|
||||
if (listCallCount == 1) {
|
||||
return [
|
||||
DriveLockFile(id: 'mine', username: 'me', createdAtUtc: now),
|
||||
DriveLockFile(
|
||||
CloudLockFile(id: 'mine', username: 'me', createdAtUtc: now),
|
||||
CloudLockFile(
|
||||
id: 'other',
|
||||
username: 'other',
|
||||
createdAtUtc: now.subtract(const Duration(seconds: 5))),
|
||||
];
|
||||
}
|
||||
return [DriveLockFile(id: 'mine', username: 'me', createdAtUtc: now)];
|
||||
return [CloudLockFile(id: 'mine', username: 'me', createdAtUtc: now)];
|
||||
},
|
||||
deleteLock: (id) async => deleteCalls.add(id),
|
||||
delay: (d) async => delayCalls.add(d),
|
||||
|
|
@ -114,14 +114,14 @@ void main() {
|
|||
listCallCount++;
|
||||
if (listCallCount == 1) {
|
||||
return [
|
||||
DriveLockFile(id: 'mine', username: 'me', createdAtUtc: now),
|
||||
DriveLockFile(
|
||||
CloudLockFile(id: 'mine', username: 'me', createdAtUtc: now),
|
||||
CloudLockFile(
|
||||
id: 'stale',
|
||||
username: 'ghost',
|
||||
createdAtUtc: now.subtract(const Duration(minutes: 15))),
|
||||
];
|
||||
}
|
||||
return [DriveLockFile(id: 'mine', username: 'me', createdAtUtc: now)];
|
||||
return [CloudLockFile(id: 'mine', username: 'me', createdAtUtc: now)];
|
||||
},
|
||||
deleteLock: (id) async => deleteCalls.add(id),
|
||||
delay: (_) async {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue