Skip to content

Commit

Permalink
updated doc message to be consistent with other apis, used proper var…
Browse files Browse the repository at this point in the history
…iables in tests
  • Loading branch information
ekjotmultani committed Oct 23, 2024
1 parent f8c4e57 commit 4b3f68d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class StorageListOptions
/// {@macro amplify_core.storage.list_plugin_options}
final StorageListPluginOptions? pluginOptions;

/// an optional bucket to specify which bucket to return the list for
/// Optionally specify which bucket to retrieve
final StorageBucket? bucket;

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,20 @@ void main() {
);
setUpAll(() async {
await configure(amplifyEnvironments['main']!);
for (var i = 0; i < 4; i++) {
for (var pathIndex = 0;
pathIndex < uploadedPaths.length ~/ 2;
pathIndex++) {
await Amplify.Storage.uploadData(
path: StoragePath.fromString(uploadedPaths[i]),
path: StoragePath.fromString(uploadedPaths[pathIndex]),
data: StorageDataPayload.bytes('test content'.codeUnits),
bucket: mainBucket,
).result;
}
for (var i = 4; i < 8; i++) {
for (var pathIndex = uploadedPaths.length ~/ 2;
pathIndex < uploadedPaths.length;
pathIndex++) {
await Amplify.Storage.uploadData(
path: StoragePath.fromString(uploadedPaths[i]),
path: StoragePath.fromString(uploadedPaths[pathIndex]),
data: StorageDataPayload.bytes('test content'.codeUnits),
bucket: secondaryBucket,
).result;
Expand All @@ -64,17 +68,21 @@ void main() {
bucket: secondaryBucket,
),
).result;
for (var i = 0; i < 4; i++) {
for (var pathIndex = 0;
pathIndex < uploadedPaths.length ~/ 2;
pathIndex++) {
expect(
listResultMainBucket.items
.any((item) => item.path == uploadedPaths[i]),
.any((item) => item.path == uploadedPaths[pathIndex]),
isTrue,
);
}
for (var i = 4; i < 8; i++) {
for (var pathIndex = uploadedPaths.length ~/ 2;
pathIndex < uploadedPaths.length;
pathIndex++) {
expect(
listResultSecondaryBucket.items
.any((item) => item.path == uploadedPaths[i]),
.any((item) => item.path == uploadedPaths[pathIndex]),
isTrue,
);
}
Expand Down

0 comments on commit 4b3f68d

Please sign in to comment.