def test_op_exec_method_doesnt_exist(mock_boto): """Operation exec calling non existent method gets AttributeError.""" # somewhat arbitrarily using an int as spec for client, since it # won't have an arbmethod. with pytest.raises(AttributeError) as err_info: paws.operation_exec(service_name='test svc', method_name='arbmethod', operation_args={ 'k1': 'v1', 'k2': 'v2' }) assert str(err_info.value) == "Mock object has no attribute 'arbmethod'"
def test_op_exec_no_client_args(mock_boto): """Operation exec with no client args pass.""" mock_boto.return_value.arbmethod.return_value = { 'arbreturnk1': 'arbreturnv1'} response = paws.operation_exec(service_name='test svc', method_name='arbmethod', operation_args={'k1': 'v1', 'k2': 'v2'}) assert response mock_boto.assert_called_once_with('test svc') mock_boto.return_value.arbmethod.assert_called_once_with( k1='v1', k2='v2') assert response == {'arbreturnk1': 'arbreturnv1'}