Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions atom/src/member.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,10 @@ parse_mode_and_context( PyObject*const *args, Py_ssize_t n, PyObject** context,
{

if( n != 2 )
{
cppy::type_error( "set mode requires two arguments mode, context" );
return false;
}
if( !EnumTypes::from_py_enum( args[0], mode ) )
return false;
*context = args[1];
Expand Down
9 changes: 9 additions & 0 deletions tests/test_get_behaviors.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,12 @@ class SlotAtom(Atom):

with pytest.raises(AttributeError):
SlotAtom.v.do_getattr(sa)


def test_using_invalid_args():
"""Test using the invalid arguments."""
v = Value()
with pytest.raises(TypeError):
v.set_getattr_mode(None)
with pytest.raises(TypeError):
v.set_getattr_mode(7, None)
Loading