2022-09-09 18:28:41 +00:00
|
|
|
from uvloop import _testbase as tb
|
|
|
|
from uvloop.loop import libuv_get_loop_t_ptr, libuv_get_version
|
|
|
|
|
|
|
|
|
|
|
|
class Test_UV_libuv(tb.UVTestCase):
|
|
|
|
def test_libuv_get_loop_t_ptr(self):
|
|
|
|
loop = self.new_loop()
|
|
|
|
cap1 = libuv_get_loop_t_ptr(loop)
|
|
|
|
cap2 = libuv_get_loop_t_ptr(loop)
|
|
|
|
cap3 = libuv_get_loop_t_ptr(self.new_loop())
|
|
|
|
|
|
|
|
import pyximport
|
|
|
|
|
|
|
|
pyximport.install()
|
|
|
|
|
2022-09-10 15:45:27 +00:00
|
|
|
import cython_helper
|
2022-09-09 18:28:41 +00:00
|
|
|
|
|
|
|
self.assertTrue(cython_helper.capsule_equals(cap1, cap2))
|
|
|
|
self.assertFalse(cython_helper.capsule_equals(cap1, cap3))
|
|
|
|
|
|
|
|
def test_libuv_get_version(self):
|
|
|
|
self.assertGreater(libuv_get_version(), 0)
|