test/api: show that prepare crashes in an undisciplined way on bad input

(and we know it sometimes it also does not crash on bad input ...)
1 files changed, 12 insertions(+), 0 deletions(-)

M tests/test_api.py
M tests/test_api.py +12 -0
@@ 266,6 266,18 @@ def test_prepare_with_inputs(engine, cle
     res = engine.execute('select count(*) from rework.sched').scalar()
     assert res == 1
 
+    failargs = args.copy()
+    failargs['name'] = 42
+    with pytest.raises(AttributeError):
+        api.prepare(
+            engine,
+            'yummy',
+            rule='* * * * * *',
+            _anyrule=True,
+            inputdata=failargs,
+            metadata={'user': 'Babar'}
+        )
+
     with pytest.raises(ValueError) as err:
         api.prepare(
             engine,