use v6; use Test; use AWS::Session; use lib 't/lib'; use Test::AWS::Session; plan 2; subtest 'happy-session', { my $session = AWS::Session.new( session-configuration => TEST-SESSION-DEFAULTS(), data-path => 't/aws/my-data'.IO, ); isa-ok $session, AWS::Session; is $session.profile, 'default'; is $session.region, 'us-west-1'; is $session.data-path, 't/aws/my-data'; is $session.config-file, 't/aws/config'; is $session.ca-bundle, Nil; is $session.api-versions, {}; is $session.credentials-file, 't/aws/credentials'; is $session.metadata-service-timeout, 1; is $session.metadata-service-num-attempts, 1; is $session.get-configuration., 'us-west-1'; is $session.get-current-configuration., 'json'; is $session.get-profile-configuration('fun')., 'us-east-2'; is $session.get-credentials., 'AKEYDEFAULTDEFAULTDE'; is $session.get-current-credentials., 'SecretSecretSecretSecretSecretSecretSecr'; is $session.get-profile-credentials('fun')., 'AKEYFUNFUNFUNFUNFUNF'; } subtest 'sad-session', { my $session = AWS::Session.new( session-configuration => TEST-SESSION-SAD-DEFAULTS(), data-path => 't/aws.not-here/my-data'.IO, ); isa-ok $session, AWS::Session; is $session.profile, 'default'; is $session.region, Nil; is $session.data-path, 't/aws.not-here/my-data'; is $session.config-file, 't/aws.not-here/config'; is $session.ca-bundle, Nil; is $session.api-versions, {}; is $session.credentials-file, 't/aws.not-here/credentials'; is $session.metadata-service-timeout, 1; is $session.metadata-service-num-attempts, 1; nok $session.get-configuration.; nok $session.get-current-configuration.; nok $session.get-profile-configuration('fun').; nok $session.get-credentials.; nok $session.get-current-credentials.; nok $session.get-profile-credentials('fun').; } done-testing;