diff options
| author | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
|---|---|---|
| committer | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
| commit | 449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch) | |
| tree | c131c3528c4d517f56e19b854a7453fedb097d40 /test/utils/android_file_utils.dart | |
| download | aves-src-master.tar.gz aves-src-master.zip | |
Diffstat (limited to 'test/utils/android_file_utils.dart')
| -rw-r--r-- | test/utils/android_file_utils.dart | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/utils/android_file_utils.dart b/test/utils/android_file_utils.dart new file mode 100644 index 0000000..581acb9 --- /dev/null +++ b/test/utils/android_file_utils.dart @@ -0,0 +1,27 @@ +import 'package:aves/services/common/services.dart'; +import 'package:aves/services/storage_service.dart'; +import 'package:aves/utils/android_file_utils.dart'; +import 'package:path/path.dart' as p; +import 'package:test/test.dart'; + +import '../fake/storage_service.dart'; + +void main() { + setUp(() async { + // specify Posix style path context for consistent behaviour when running tests on Windows + getIt.registerLazySingleton<p.Context>(() => p.Context(style: p.Style.posix)); + + getIt.registerLazySingleton<StorageService>(FakeStorageService.new); + + await androidFileUtils.init(); + }); + + tearDown(() async { + await getIt.reset(); + }); + + test('camera album identification', () { + expect(androidFileUtils.isCameraPath('${FakeStorageService.primaryPath}DCIM/Camera'), true); + expect(androidFileUtils.isCameraPath('${FakeStorageService.primaryPath}DCIM/YoloCamera'), false); + }); +} |
