def test_that_when_describing_policy_on_client_error_it_returns_error(self): ''' Tests describing parameters failure ''' self.conn.get_policy.side_effect = ClientError(error_content, 'get_policy') result = boto_iot.describe_policy(policyName='testpolicy', **conn_parameters) self.assertTrue('error' in result)
def test_that_when_describing_policy_on_client_error_it_returns_error(self): """ Tests describing parameters failure """ self.conn.get_policy.side_effect = ClientError(error_content, "get_policy") result = boto_iot.describe_policy(policyName="testpolicy", **conn_parameters) assert "error" in result
def test_that_when_describing_policy_it_returns_the_dict_of_properties_returns_false(self): ''' Tests describing parameters if policy does not exist ''' self.conn.get_policy.side_effect = not_found_error result = boto_iot.describe_policy(policyName='testpolicy', **conn_parameters) self.assertFalse(result['policy'])
def test_that_when_describing_policy_it_returns_the_dict_of_properties_returns_true(self): ''' Tests describing parameters if policy exists ''' self.conn.get_policy.return_value = {'policy': policy_ret} result = boto_iot.describe_policy(policyName=policy_ret['policyName'], **conn_parameters) self.assertTrue(result['policy'])
def test_that_when_describing_policy_it_returns_the_dict_of_properties_returns_false( self, ): """ Tests describing parameters if policy does not exist """ self.conn.get_policy.side_effect = not_found_error result = boto_iot.describe_policy(policyName="testpolicy", **conn_parameters) assert not result["policy"]
def test_that_when_describing_policy_on_client_error_it_returns_error( boto_conn): ''' Tests describing parameters failure ''' boto_conn.get_policy.side_effect = exceptions.ClientError( error_content, 'get_policy') result = boto_iot.describe_policy(policyName='testpolicy', **pytest.conn_parameters) assert 'error' in result
def test_that_when_describing_policy_it_returns_the_dict_of_properties_returns_true( self, ): """ Tests describing parameters if policy exists """ self.conn.get_policy.return_value = {"policy": policy_ret} result = boto_iot.describe_policy(policyName=policy_ret["policyName"], **conn_parameters) assert result["policy"]