def test_that_when_describing_a_named_identity_pool_and_pool_does_not_exist_the_describe_identity_pool_method_returns_none(self):
     '''
     Tests describing identity pool when the pool's name doesn't exist
     '''
     self.conn.list_identity_pools.return_value = identity_pools_ret
     self.conn.describe_identity_pool.return_value = first_pool_ret
     result = boto_cognitoidentity.describe_identity_pools(IdentityPoolName='no_such_pool', **conn_parameters)
     self.assertEqual(result.get('identity_pools', 'no such key'), None)
 def test_that_when_describing_a_named_identity_pool_and_error_thrown_the_describe_identity_pool_method_returns_error(self):
     '''
     Tests describing identity pool returns error when there is an exception to boto3 calls
     '''
     self.conn.list_identity_pools.return_value = identity_pools_ret
     self.conn.describe_identity_pool.side_effect = ClientError(error_content, 'error on describe identity pool')
     result = boto_cognitoidentity.describe_identity_pools(IdentityPoolName=first_pool_name, **conn_parameters)
     self.assertEqual(result.get('error', {}).get('message'), error_message.format('error on describe identity pool'))
 def test_that_when_describing_a_named_identity_pool_and_pool_exists_the_describe_identity_pool_method_returns_pools_properties(self):
     '''
     Tests describing identity pool when the pool's name exists
     '''
     self.conn.list_identity_pools.return_value = identity_pools_ret
     self.conn.describe_identity_pool.side_effect = self._describe_identity_pool_side_effect
     result = boto_cognitoidentity.describe_identity_pools(IdentityPoolName=first_pool_name, **conn_parameters)
     self.assertEqual(result.get('identity_pools'), [first_pool_ret, third_pool_ret])
 def test_that_when_describing_a_identity_pool_by_its_id_and_pool_exists_the_desribe_identity_pool_method_returns_pools_properties(self):
     '''
     Tests describing identity pool when the given pool's id exists
     '''
     self.conn.describe_identity_pool.return_value = third_pool_ret
     result = boto_cognitoidentity.describe_identity_pools(IdentityPoolName='', IdentityPoolId=third_pool_id, **conn_parameters)
     self.assertEqual(result.get('identity_pools'), [third_pool_ret])
     self.assertTrue(self.conn.list_identity_pools.call_count == 0)
Exemplo n.º 5
0
 def test_that_when_describing_a_named_identity_pool_and_pool_does_not_exist_the_describe_identity_pool_method_returns_none(
     self
 ):
     """
     Tests describing identity pool when the pool's name doesn't exist
     """
     self.conn.list_identity_pools.return_value = identity_pools_ret
     self.conn.describe_identity_pool.return_value = first_pool_ret
     result = boto_cognitoidentity.describe_identity_pools(IdentityPoolName="no_such_pool", **conn_parameters)
     self.assertEqual(result.get("identity_pools", "no such key"), None)
Exemplo n.º 6
0
 def test_that_when_describing_a_named_identity_pool_and_pool_exists_the_describe_identity_pool_method_returns_pools_properties(
     self
 ):
     """
     Tests describing identity pool when the pool's name exists
     """
     self.conn.list_identity_pools.return_value = identity_pools_ret
     self.conn.describe_identity_pool.side_effect = self._describe_identity_pool_side_effect
     result = boto_cognitoidentity.describe_identity_pools(IdentityPoolName=first_pool_name, **conn_parameters)
     self.assertEqual(result.get("identity_pools"), [first_pool_ret, third_pool_ret])
 def test_that_when_describing_a_named_identity_pool_and_pool_does_not_exist_the_describe_identity_pool_method_returns_none(
     self, ):
     """
     Tests describing identity pool when the pool's name doesn't exist
     """
     self.conn.list_identity_pools.return_value = identity_pools_ret
     self.conn.describe_identity_pool.return_value = first_pool_ret
     result = boto_cognitoidentity.describe_identity_pools(
         IdentityPoolName="no_such_pool", **conn_parameters)
     assert result.get("identity_pools", "no such key") == None
Exemplo n.º 8
0
 def test_that_when_describing_a_named_identity_pool_and_error_thrown_the_describe_identity_pool_method_returns_error(
     self
 ):
     """
     Tests describing identity pool returns error when there is an exception to boto3 calls
     """
     self.conn.list_identity_pools.return_value = identity_pools_ret
     self.conn.describe_identity_pool.side_effect = ClientError(error_content, "error on describe identity pool")
     result = boto_cognitoidentity.describe_identity_pools(IdentityPoolName=first_pool_name, **conn_parameters)
     self.assertEqual(
         result.get("error", {}).get("message"), error_message.format("error on describe identity pool")
     )
Exemplo n.º 9
0
 def test_that_when_describing_a_identity_pool_by_its_id_and_pool_exists_the_desribe_identity_pool_method_returns_pools_properties(
     self
 ):
     """
     Tests describing identity pool when the given pool's id exists
     """
     self.conn.describe_identity_pool.return_value = third_pool_ret
     result = boto_cognitoidentity.describe_identity_pools(
         IdentityPoolName="", IdentityPoolId=third_pool_id, **conn_parameters
     )
     self.assertEqual(result.get("identity_pools"), [third_pool_ret])
     self.conn.list_identity_pools.assert_not_called()
 def test_that_when_describing_a_named_identity_pool_and_error_thrown_the_describe_identity_pool_method_returns_error(
     self, ):
     """
     Tests describing identity pool returns error when there is an exception to boto3 calls
     """
     self.conn.list_identity_pools.return_value = identity_pools_ret
     self.conn.describe_identity_pool.side_effect = ClientError(
         error_content, "error on describe identity pool")
     result = boto_cognitoidentity.describe_identity_pools(
         IdentityPoolName=first_pool_name, **conn_parameters)
     assert result.get("error", {}).get("message") == error_message.format(
         "error on describe identity pool")
 def test_that_when_describing_a_identity_pool_by_its_id_and_pool_exists_the_desribe_identity_pool_method_returns_pools_properties(
     self, ):
     """
     Tests describing identity pool when the given pool's id exists
     """
     self.conn.describe_identity_pool.return_value = third_pool_ret
     result = boto_cognitoidentity.describe_identity_pools(
         IdentityPoolName="",
         IdentityPoolId=third_pool_id,
         **conn_parameters)
     assert result.get("identity_pools") == [third_pool_ret]
     assert self.conn.list_identity_pools.call_count == 0