Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Minio Dart
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
images
Minio Dart
Commits
7e4a09d3
Commit
7e4a09d3
authored
4 years ago
by
philenius
Browse files
Options
Downloads
Patches
Plain Diff
add unit tests for listBuckets()
parent
32f01fe9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/minio.dart
+1
-3
1 addition, 3 deletions
lib/minio.dart
test/minio_dart_test.dart
+62
-9
62 additions, 9 deletions
test/minio_dart_test.dart
with
63 additions
and
12 deletions
lib/minio.dart
+
1
−
3
View file @
7e4a09d3
/// Support for doing something awesome.
///
/// More dartdocs go here.
library
minio
;
export
'src/minio.dart'
;
export
'src/minio_errors.dart'
;
// TODO: Export any libraries intended for clients of this package.
This diff is collapsed.
Click to expand it.
test/minio_dart_test.dart
+
62
−
9
View file @
7e4a09d3
import
'package:minio/minio.dart'
;
import
'package:test/test.dart'
;
void
main
()
{
// group('A group of tests', () {
// Awesome awesome;
group
(
'listBuckets'
,
()
{
test
(
'listBuckets() succeeds'
,
()
async
{
final
minio
=
_getClient
();
// setUp(() {
// awesome = Awesome();
// });
expect
(()
async
=
>
await
minio
.
listBuckets
(),
returnsNormally
);
});
// test('First Test', () {
// expect(awesome.isAwesome, isTrue);
// });
// });
test
(
'listBuckets() fails due to wrong access key'
,
()
async
{
final
minio
=
_getClient
(
accessKey:
'incorrect-access-key'
);
expect
(
()
async
=
>
await
minio
.
listBuckets
(),
throwsA
(
isA
<
MinioError
>()
.
having
(
(
e
)
=
>
e
.
message
,
'message'
,
'The Access Key Id you provided does not exist in our records.'
,
),
),
);
});
test
(
'listBuckets() fails due to wrong secret key'
,
()
async
{
final
minio
=
_getClient
(
secretKey:
'incorrect-secret-key'
);
expect
(
()
async
=
>
await
minio
.
listBuckets
(),
throwsA
(
isA
<
MinioError
>()
.
having
(
(
e
)
=
>
e
.
message
,
'message'
,
'The request signature we calculated does not match the signature you provided. Check your key and signing method.'
,
),
),
);
});
});
}
/// Initializes an instance of [Minio] with per default valid configuration.
///
/// Don't worry, these credentials for MinIO are publicly available and
/// connect only to the MinIO demo server at `play.minio.io`.
Minio
_getClient
({
String
endpoint
=
'play.minio.io'
,
int
port
=
443
,
bool
useSSL
=
true
,
String
accessKey
=
'Q3AM3UQ867SPQQA43P2F'
,
String
secretKey
=
'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
,
String
sessionToken
=
''
,
String
region
=
'us-east-1'
,
bool
enableTrace
=
false
,
})
=
>
Minio
(
endPoint:
endpoint
,
port:
port
,
useSSL:
useSSL
,
accessKey:
accessKey
,
secretKey:
secretKey
,
sessionToken:
sessionToken
,
region:
region
,
enableTrace:
enableTrace
,
);
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment