refactor: rework test to be more specific
This commit is contained in:
@@ -62,8 +62,9 @@ PyObject* pyopencv_from(const T& src) { return PyOpenCV_Converter<T>::from(src);
|
||||
template<typename _Tp, int m, int n>
|
||||
bool pyopencv_to(PyObject* o, cv::Matx<_Tp, m, n>& mx, const ArgInfo& info)
|
||||
{
|
||||
if (!o || o == Py_None)
|
||||
if (!o || o == Py_None) {
|
||||
return true;
|
||||
}
|
||||
|
||||
cv::Mat tmp;
|
||||
if (!pyopencv_to(o, tmp, info)) {
|
||||
|
||||
@@ -736,6 +736,13 @@ class CanUsePurePythonModuleFunction(NewOpenCVTests):
|
||||
res = cv.utils._native.testOverwriteNativeMethod(123)
|
||||
self.assertEqual(res, 123, msg="Failed to call native method implementation")
|
||||
|
||||
def test_default_matx_argument(self):
|
||||
res = cv.utils.dumpVec2i()
|
||||
self.assertEqual(res, "Vec2i(42, 24)",
|
||||
msg="Default argument is not properly handled")
|
||||
res = cv.utils.dumpVec2i((12, 21))
|
||||
self.assertEqual(res, "Vec2i(12, 21)")
|
||||
|
||||
|
||||
class SamplesFindFile(NewOpenCVTests):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user