def test_invalid_argument_type(self): selection_set = _.knows_command(command='foobar') with pytest.raises(quiz.SelectionError) as exc: quiz.validate(Dog, selection_set) assert exc.value == quiz.SelectionError( Dog, 'knows_command', quiz.InvalidArgumentType('command', 'foobar'))
def test_invalid_argument(self): with pytest.raises(quiz.SelectionError) as exc: quiz.validate(Dog, _.knows_command( foo=1, command=Command.SIT)) assert exc.value == quiz.SelectionError( Dog, 'knows_command', quiz.NoSuchArgument('foo'))