diff --git a/hy_odoo/test.hy b/hy_odoo/test.hy index a1b6ec2..eb020e3 100644 --- a/hy_odoo/test.hy +++ b/hy_odoo/test.hy @@ -27,3 +27,10 @@ (defmacro odo-assert-raises [Error body] "Macro to test Error with self.assertRaises and do block" `(with [err (.assertRaises self ~Error)] ~body)) + +(defmacro o-test [name body] + "Macro for unit test case" + (setv fn-name (% "test-%s" (str name)) + humanized-name (.replace (str name) "-" " ") + descr (bytes (% "Test %s" humanized-name))) + `(defn ~(HySymbol fn-name) [self] ~descr ~body))