refactor: rework test to be more specific

This commit is contained in:
Vadim Levin
2022-11-30 17:40:38 +03:00
parent f1055a7e91
commit 3a15152be5
6 changed files with 14 additions and 30 deletions
+2 -1
View File
@@ -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)) {
+7
View File
@@ -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):