Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/b/o/botocore-HEAD/tests/unit/test_credentials.py   botocore(Download)
 
        self.session.set_config_variable('metadata_service_timeout', 10)
        iam_creds = credentials.InstanceMetadataProvider(session=self.session)
        iam_creds.load()
        self.assertEqual(get.call_args[1]['timeout'], 10)
 
        self.session.set_config_variable('metadata_service_timeout', 10)
        iam_creds = credentials.InstanceMetadataProvider(session=self.session)
        d = iam_creds.load()
        self.assertEqual(d, None)
 
        self.session.set_config_variable('metadata_service_num_attempts', 2)
        iam_creds = credentials.InstanceMetadataProvider(session=self.session)
        retrieved = iam_creds.load()
        # Using the property would see an expired set of credentials (old
            self.small_resolver.insert_before(
                'foobar',
                credentials.InstanceMetadataProvider()
            )
 
            self.small_resolver.insert_after(
                'foobar',
                credentials.InstanceMetadataProvider()
            )