summaryrefslogtreecommitdiffstats
path: root/contrib/libs/python/ut/lib
diff options
context:
space:
mode:
authormaxim-yurchuk <[email protected]>2024-10-09 12:29:46 +0300
committermaxim-yurchuk <[email protected]>2024-10-09 13:14:22 +0300
commit9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch)
treea8fb3181d5947c0d78cf402aa56e686130179049 /contrib/libs/python/ut/lib
parenta44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff)
publishFullContrib: true for ydb
<HIDDEN_URL> commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/libs/python/ut/lib')
-rw-r--r--contrib/libs/python/ut/lib/test.cpp21
-rw-r--r--contrib/libs/python/ut/lib/test.h7
-rw-r--r--contrib/libs/python/ut/lib/ya.make19
3 files changed, 47 insertions, 0 deletions
diff --git a/contrib/libs/python/ut/lib/test.cpp b/contrib/libs/python/ut/lib/test.cpp
new file mode 100644
index 00000000000..e3aabc8889f
--- /dev/null
+++ b/contrib/libs/python/ut/lib/test.cpp
@@ -0,0 +1,21 @@
+#include "test.h"
+
+#include <Python.h>
+#include <library/cpp/testing/unittest/registar.h>
+
+TTestPyInvoker::TTestPyInvoker() {}
+
+const char* TTestPyInvoker::GetVersion() {
+ Py_Initialize();
+
+ auto* module = PyImport_ImportModule("sys");
+ UNIT_ASSERT(module != nullptr);
+
+ auto* versionObj = PyObject_GetAttrString(module, "version");
+ if (versionObj == nullptr) {
+ Py_DECREF(module);
+ UNIT_ASSERT(versionObj != nullptr);
+ }
+
+ return Py_GetVersion();
+}
diff --git a/contrib/libs/python/ut/lib/test.h b/contrib/libs/python/ut/lib/test.h
new file mode 100644
index 00000000000..1bf824ebea8
--- /dev/null
+++ b/contrib/libs/python/ut/lib/test.h
@@ -0,0 +1,7 @@
+#pragma once
+
+class TTestPyInvoker {
+public:
+ TTestPyInvoker();
+ const char* GetVersion();
+};
diff --git a/contrib/libs/python/ut/lib/ya.make b/contrib/libs/python/ut/lib/ya.make
new file mode 100644
index 00000000000..616d23b2cc0
--- /dev/null
+++ b/contrib/libs/python/ut/lib/ya.make
@@ -0,0 +1,19 @@
+SUBSCRIBER(spreis)
+
+PY23_LIBRARY()
+
+WITHOUT_LICENSE_TEXTS()
+
+VERSION(Service-proxy-version)
+
+LICENSE(YandexOpen)
+
+PEERDIR(
+ library/cpp/testing/unittest
+)
+
+SRCS(
+ test.cpp
+)
+
+END()