def test_get_waiter_does_not_exist(self):
     waiters = {
         'version': 2,
         'waiters': {}
     }
     model = WaiterModel(waiters)
     with self.assertRaises(ValueError):
         model.get_waiter('UnknownWaiter')
Exemple #2
0
 def test_get_single_waiter_config(self):
     single_waiter = {
         'description':
         'Waiter description',
         'operation':
         'HeadBucket',
         'delay':
         5,
         'maxAttempts':
         20,
         'acceptors': [
             {
                 'state': 'success',
                 'matcher': 'status',
                 'expected': 200
             },
             {
                 'state': 'retry',
                 'matcher': 'status',
                 'expected': 404
             },
         ],
     }
     waiters = {
         'version': 2,
         'waiters': {
             'BucketExists': single_waiter,
         }
     }
     model = WaiterModel(waiters)
     config = model.get_waiter('BucketExists')
     self.assertEqual(config.operation, 'HeadBucket')